Re: Battery Status API aligned with Mozilla's implementation

On 10/25/2011 05:11 PM, Jonas Sicking wrote:
> On Tue, Oct 25, 2011 at 8:57 AM,<Cathy.Chan@nokia.com>  wrote:
>>
>>> On 24.10.2011, at 10.16, ext Anssi Kostiainen wrote:
>>>
>>> I replaced 'chargingState' of type DOMString with 'charging' of type
>> boolean:
>>>
>>> [[
>>>
>>> charging of type boolean, readonly
>>>
>>> Represents if the system's battery is charging. The attribute must be set
>> to
>>> true if the battery is charging, and set to false otherwise, or if the
>>> implementation is unable to report the state, or there is no battery
>> attached
>>> to the system.
>>>
>>> ]]
>>
>> I assume that charging is also set to true when the battery is full?
>> - Cathy.
>
> As long as the cable is still plugged in I would assume so too.
>
> Maybe it would be better to call the property .pluggedin or some such?
> (I generally try to stay out of naming discussions, but I figured I
> should bring it up).

With .plugged or .pluggedIn, we get the confusion with device being 
plugged but not charging (like a tablet plugged via USB).

I don't think it's a big deal to keep charging = true when the battery 
is actually full. We could rename this property discharging which might 
solve the issue but would be weird IMO. Otherwise, we can go with the 
multiple state property ;)

--
Mounir

Received on Tuesday, 25 October 2011 17:32:49 UTC