This specification defines a concrete sensor interface to monitor
to measure the ambient temperature.
Status of this document
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
If you wish to make comments regarding this document, please send them to public-device-apis@w3.org (subscribe, archives).
When sending e-mail,
please put the text “thermometer” in the subject,
preferably like this:
“[thermometer] …summary of comment…”.
All comments are welcome.
The Temperature Sensor extends the Generic Sensor API [GENERIC-SENSOR] to provide information about the ambient temperature, as detected by the
device’s primary temperature sensor.
The temperature level is reported in either celsius, fahrenheit or kelvin
and represents the local temperature level. Some devices, such as phones,
might report inflated values due to the proximity of battery.
The Temperature Sensor has an associated abstract operation
to retrieve the sensor permission which
must simply return a permission whose name is "temperature".
The Temperature Sensor has an associated abstract operation
to construct a SensorReading object which creates a new TemperatureSensorReading object and sets each of its celsius, fahrenheit and kelvin attributes to
positive infinity.
celsius is a value that represents the the local ambient temperature. Its
unit is degrees Celsius, also known as centigrade.
fahrenheit is a value that represents the the local ambient temperature. Its
unit is degrees Fahrenheit.
kelvin is a value that represents the the local ambient temperature. Its
unit is degrees Kelvin.
The celsius attribute of the TemperatureSensorReading interface represents the local ambient temperature level in degree Celsius, also known
as centigrade.
The kelvin attribute of the TemperatureSensorReading interface represents the local ambient temperature level in degree Kelvin.
6. Acknowledgements
Tobie Langel for the work on Generic Sensor API.
Conformance
Document conventions
Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words “MUST”,
“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. [RFC2119]
Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with class="example",
like this:
This is an example of an informative example.
Informative notes begin with the word “Note” and are set apart from the
normative text with class="note", like this:
Note, this is an informative note.
Conformant Algorithms
Requirements phrased in the imperative as part of algorithms (such as
"strip any leading space characters" or "return false and abort these
steps") are to be interpreted with the meaning of the key word ("must",
"should", "may", etc) used in introducing the algorithm.
Conformance requirements phrased as algorithms or specific steps can be
implemented in any manner, so long as the end result is equivalent. In
particular, the algorithms defined in this specification are intended to
be easy to understand and are not intended to be performant. Implementers
are encouraged to optimize.
Conformance Classes
A conformant user agent must implement all the requirements
listed in this specification that are applicable to user agents.
A conformant server must implement all the requirements listed
in this specification that are applicable to servers.