W3C home > Mailing lists > Public > public-device-apis@w3.org > December 2011

Re: no longer possible to detect battery presence? RE: Battery API in Last Call

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Fri, 02 Dec 2011 23:59:59 +0100
Message-ID: <4ED9586F.2000009@lamouri.fr>
To: public-device-apis@w3.org
On 12/02/2011 07:57 PM, Tran, Dzung D wrote:
> A suggestion is to reword the following: The spec could be reworded to the following:
>
> Currently it is:
> readonly attribute boolean charging
> Represents if the system's battery is charging. The attribute MUST be set to false if the battery is discharging, and set to true, if the battery is charging, full, the implementation is unable to report the state, or there is no battery attached to the system, or otherwise.
>
> to something:
> Represents if the system's battery is charging. The attribute MUST be set to false if the battery is discharging, and set to true if the battery is charging. If the battery status cannot be determined, the implementation should raise an error or an undefined state.

I don't think this is the way we want to go: exceptions shouldn't be 
thrown for a common state and using a { "yes", "no", "na" } enum would 
be a bad idea for already given reasons.

In addition, I don't see why that would be useful.

--
Mounir
Received on Friday, 2 December 2011 23:00:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:26 GMT