W3C home > Mailing lists > Public > public-device-apis@w3.org > July 2014

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

From: Kostiainen, Anssi <anssi.kostiainen@intel.com>
Date: Tue, 1 Jul 2014 09:29:57 +0000
To: Tim Volodine <timvolodine@google.com>
CC: "frederick.hirsch@nokia.com" <frederick.hirsch@nokia.com>, "W3C Device APIs WG" <public-device-apis@w3.org>, "ldeluca@us.ibm.com" <ldeluca@us.ibm.com>
Message-ID: <9C8864F8-0747-4BCA-B1F0-EC55B176FAEC@intel.com>
Hi Tim,

On 26 Jun 2014, at 20:57, Tim Volodine <timvolodine@google.com> 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:

https://dvcs.w3.org/hg/dap/rev/b84afc1ef2b0

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.

Fixed:

https://dvcs.w3.org/hg/dap/rev/7857ba0e4266

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

https://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html

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.

Thanks,

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:33:10 UTC