Re: [battery] Moving Battery API forward, next steps?

Hi Tim,

On 26 Jun 2014, at 20:57, Tim Volodine <> wrote:

> A few more comments on the current Battery Status API specification:
> 1. default value for chargingTime:
> I think this has been raised in previous comments, but the default value for chargingTime is still unclear. I think the first paragraph about default values should look like:
> "When the promise is resolved with the battery manager object and the implementation is unable to provide any battery information the default values should be as follows (which is equivalent to a fully charged battery):
> charging=true, chargingTime=0, dischargingTime=Inf, level=1."
> The "any" clause is important because in the paragraphs below the chargingTime is said to be +Inf if it cannot be provided by the implementation, which by the way makes more sense than 0 for platforms where this attribute cannot be provided (possibly temporarily).

Updated as per your suggestions with minor edits:

Revisiting this, I think “any” makes this deterministic, simpler for web developers.

[IOW, if a web developer gets charging=true, chargingTime=0, dischargingTime=Inf, level=1 from getBattery(), then she know that either the battery is full or the system is unable to given me the information. In such a case, she'd likely add appropriate listeners for *change events she’s interested in to get real values.]

> 2. multiple batteries:
> level -- instead of "sum" of levels it should be "average",
> dischargingTime -- should be max dischargingTime if in parallel and sum if in series.


Thanks for your comments! Please confirm if the spec looks good to you now:

I hope we get the remaining rough edges ironed out, so that people have time to review the draft before the LC publication tentatively scheduled for 14 August.



Received on Tuesday, 1 July 2014 09:30:49 UTC