Re: Battery Status API aligned with Mozilla's implementation

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 UTC