Re: Battery Status API aligned with Mozilla's implementation

On 25.10.2011, at 22.56, ext Jonas Sicking wrote:

> On Tue, Oct 25, 2011 at 10:32 AM, Mounir Lamouri <mounir@lamouri.fr> wrote:
>> On 10/25/2011 05:11 PM, Jonas Sicking wrote:
>>> 
>>> On Tue, Oct 25, 2011 at 8:57 AM,<Cathy.Chan@nokia.com>  wrote:
>>>> 
>>>> I assume that charging is also set to true when the battery is full?
>>> 
>>> 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 ;)
> 
> Either .pluggedin or .charging IMHO. I agree it would be weird to invert it.

Agreed. In the latest draft 'charging' is set to true also if the battery is full. In addition, discharging is explicitly mentioned. Here's the latest prose:

[[

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 or full, and set to false, if the battery is discharging, the implementation is unable to report the state, or there is no battery attached to the system, or otherwise.

]]

The concept of plugging in may be something that will go the way of ethernet cables (think wireless charging and such), thus 'charging' name seems like something that may stand up to the ravages of time better.

As usual, if you have concerns with this change, let me know.

-Anssi

[Bikeshedding: we did initially name the attribute 'isPlugged' for the same reasons discussed above, but now after some reiteration 'charging' sounds better, at least to me ;)]

Received on Wednesday, 26 October 2011 07:28:32 UTC