W3C home > Mailing lists > Public > public-device-status@w3.org > October 2011

Re: Battery Status API aligned with Mozilla's implementation

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Fri, 21 Oct 2011 13:04:15 +0300
Message-Id: <812ED35C-D987-4835-8AF0-FC51B2A65AD0@nokia.com>
To: public-device-status@w3.org
On 21.10.2011, at 10.35, ext Anssi Kostiainen wrote:

> On 20.10.2011, at 22.27, Chan Cathy (Nokia-CIC/Boston) wrote:
> 
>> Two quick questions outside of the discussion on the representation of the
>> no-battery case in the other thread.
>> 
>> Currently the spec says that if the implementation is unable to report the
>> charging state, chargingState must be set to "full". In what situation then
>> will the value of "unknown" be used?
> 
> I think we should perhaps try to get rid of the 'unknown' state altogether and default to 'full'.


On second thought: the level 1.0 implies chargingState 'full', thus it seems like the charging boolean would be enough.

Mounir noted earlier:

[[

In addition, should we use .state with state being "charging", "discharging", "full" and "unknown" instead of just a boolean telling us if the battery is currently charging or not?

I'm wondering because it seems that most API provide at least those four states but I'm not really sure what would be the use cases. "unknown" could be for errors or uninitialized batteries but I'm not sure what are the use cases for "full".

]]

I don't have any good use cases in mind for chargingState either, and I think it is not a good idea to expose the state just because we can. I'll update the spec to charging boolean, if no one is able to come up with a decent use case for it.

-Anssi
Received on Friday, 21 October 2011 10:04:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 21 October 2011 10:04:50 GMT