-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
In #8 we agreed that sensors shouldn't be singletons because it was both useful to allow multiple instances of each sensor and necessary to support multiple sensor of a given type on a single device (think for example proximity sensors on a car).
Imagine we want to check the presence of an object on the back of a car, we'll need to get data from one of the back sensors, right?
Should we go with a generic system, taking a DOMString, that would be defined in this spec, so for example:
new Sensor.Proximity({ identifier: "back-right" });
new Sensor.Temperature({ identifier: "internal" });…or should we let specs for concrete sensors implement that the way they want? So we might get something like (trading off consistency for context):
new Sensor.Proximity({ position: "back-right" });
new Sensor.Temperature({ id: "internal" });Questions:
- Is such an identifier the right solution?
- Should we favor consistency or context?
- What happens when no identifier is passed to the constructor? Must there be a default sensor for each type so that you can do:
new Sensor.Geoloc()and notnew Sensor.Geoloc({ identifier: "default" })? - Where are those lists of sensors defined? In the concrete specs themselves? Through an API the consumer can query (e.g.
Sensor.Proximity.getAll())?
Metadata
Metadata
Assignees
Labels
No labels