Battery Status Events Playground

Hi,

I created a demo which implements the Battery Status Events specification and (naively) simulates battery-powered user agent behavior in JavaScript. You can adjust the battery level and whether the device is plugged in from the controls. A blink of an event name indicates the event has been fired, which should give you a better feel of the intended behavior. Thresholds for batterylow and batterycritical events have been set to level 20 and 10 respectively (a more intelligent implementation would not hard-code these values). To see some internals, peek into see your console.log().

The Battery Status Events Playground is at:

  http://dev.w3.org/2009/dap/docs/battery-status/battery-status.html

A modern browser with support for <input type="range"> is required (e.g. recent Chrome, Safari or Opera, sadly Firefox does not support this feature at the moment). 

Hopefully this helps people to better understand the current design, its limitations and good parts. And perhaps propose improvements to the design.

-Anssi

Received on Thursday, 8 September 2011 17:03:21 UTC