Struct foxbox_taxonomy::services::Service
[−]
[src]
pub struct Service { pub tags: HashSet<Id<TagId>>, pub id: Id<ServiceId>, pub properties: HashMap<String, String>, pub getters: HashMap<Id<Getter>, Channel<Getter>>, pub setters: HashMap<Id<Setter>, Channel<Setter>>, pub adapter: Id<AdapterId>, }
Metadata on a service. A service is a device or collection of devices that may offer services. The FoxBox itself is a service offering services such as a clock, communicating with the user through her smart devices, etc.
JSON
A service is represented by an object with the following fields:
- id: string - an id unique to this service;
- adapter: string;
- tags: array of strings;
- properties: object;
- getters: object (keys are string identifiers, for more details on values see Channel
); - setters: object (keys are string identifiers, for more details on values see Channel
);
Fields
tags | Tags describing the service. These tags can be set by the user, adapters or applications. They are used by applications to find services and services. For instance, a user may set tag "entrance" to all services placed in the entrance of his house, or a tag "blue" to a service controlling blue lights. An adapter may set tags "plugged" or "battery" to devices that respectively depend on a plugged power source or on a battery. |
id | An id unique to this service. |
properties | Service properties that are set at creation time. For instance, these can be device manufacturer, model, etc. |
getters | Getter channels connected directly to this service. |
setters | Setter channels connected directly to this service. |
adapter | Identifier of the adapter for this service. |