device_types
The device_types database contains information about a type of devices (whereas the devices database contains info about a specific instance of a device). This Database is important because it contains info on what commands are available for the device, and what microservices and endpoints are used in the use of these commands.
Sample CouchDB Entry for Raspberry Pi device-type:
{ "_id": "Pi3", (1) "_rev": "9-9a60c267a9cad92da3fb85p35cbb757d", (1) "description": "A Raspberry Pi 3", (1) "display_name": "Pi", (1) "roles": [ (2) { "_id": "ControlProcessor", "description": "Acts as a device to control the AV-API in a room" }, { "_id": "Touchpanel", "description": "A device with a touchscreen interface" }, { "_id": "EventRouter", "description": "Acts as a device that routes events through the room to other devices" } ], "commands": [ (3) { "_id": "GenericPassthroughADCP", (4) "description": "GenericPassthroughADCP", (5) "microservice": { (6) "_id": "generic-gateway-Adcp", (7) "description": "used to serialize requests to and ADCP device", (8) "address": "http://:gateway:8012" (9) }, "endpoint": { (10) "_id": "Generic Gateway", (11) "description": "A generic Gateway for use in base case where microservice exists outside of the pi issuing the requests.", (12) "path": "/:path" (13) }, "priority": 1 (14) } ] }
-
These fields are identical to the fields mentioned in detail in previous examples.
-
"roles"
: The roles of the device, described in detail in previous examples. -
"commands"
: The list of commands that can be sent to this device. -
"_id"
: the unique identifier for the command. -
"description"
: for your own use to save info about the command. -
"microservice"
: The info for the microservice used in making the command. -
"_id"
: the unique identifier for the microservice. -
"description"
: for your own use to save info about the microservice. -
"address"
: is where the microservice is running including the port it is running on. -
"endpoint"
: The API endpoint on the microservice that corresponds to the command. -
"_id"
: is the unique identifier for the enpoint. -
"description"
: for your own use to save info about the endpoint. -
"path"
: is the path to the endpoint. -
"priority"
: This is used to help determine which events are more important and need to be executed first.
Sample CouchDB Entry for SONY XBR device-type:
{ "_id": "SonyXBR", (1) "_rev": "15-8f26e6d80867548a39675c73619663bc", (1) "description": "The Sony XBR TV line.", (1) "display_name": "Sony XBR TV", (1) "output": true, (2) "destination": true, (3) "default-name": "D", (1) "default-icon": "tv", (1) "roles": [ (1) { "_id": "AudioOut", "description": "Acts as an audio output device" }, { "_id": "VideoOut", "description": "Acts as a video output device" } ], "power_states": [ (4) { "_id": "On", "description": "On", "tags": [] }, { "_id": "Standby", "description": "Standby", "tags": [] } ], "ports": [ (1) { "_id": "hdmi!1", "friendly_name": "HDMI 1", "description": "SonyTV HDMI input 1", "tags": [ "port-in", "video" ] }, ...//there are additional ports not included ], "commands": [ (1) { "_id": "Standby", "description": "Standby", "microservice": { "_id": "sony-control-microservice", "description": "", "address": "http://localhost:8007" }, "endpoint": { "_id": "Standby", "description": "Standard standby endpoint.", "path": "/:address/power/standby" }, "priority": 100 } ...//there are additional commands not included ] }
-
These fields are identical to the fields mentioned in detail in previous examples. The ones above are an example of the implementation of these fields for a SonyXBR
-
"output"
: This field designates if the device is an output device. -
"destination"
: This field designates if the device is a destination device. -
"power_states"
: This field lists the different power states of the device.