Appearance
traits/on_off.proto
Table of Contents
traits/on_off.proto
DescribeOnOffRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device |
GetOnOffRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
read_mask | google.protobuf.FieldMask | The state fields to fetch |
OnOff
Field | Type | Label | Description |
---|---|---|---|
state | OnOff.State |
OnOffSupport
OnOffSupport describes the capabilities of devices implementing this trait
Field | Type | Label | Description |
---|---|---|---|
resource_support | smartcore.types.ResourceSupport | How a named device supports read/write/pull apis |
PullOnOffRequest
A request to monitor the state of a device
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
read_mask | google.protobuf.FieldMask | The state fields to fetch | |
updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
PullOnOffResponse
Response to a Pull request for OnOffState changes
Field | Type | Label | Description |
---|---|---|---|
changes | PullOnOffResponse.Change | repeated | Changes that have occurred since the last event |
PullOnOffResponse.Change
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
on_off | OnOff | ||
change_time | google.protobuf.Timestamp | when the change occurred |
UpdateOnOffRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
on_off | OnOff | ||
update_mask | google.protobuf.FieldMask | The state fields to update |
OnOff.State
Possible states for an On-Off device
Name | Number | Description |
---|---|---|
STATE_UNSPECIFIED | 0 | |
ON | 1 | |
OFF | 2 |
OnOffApi
Applicable to devices that have a basic binary on and off functionality.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetOnOff | GetOnOffRequest | OnOff | Get the current state of the device |
UpdateOnOff | UpdateOnOffRequest | OnOff | Update the device to be on or off |
PullOnOff | PullOnOffRequest | PullOnOffResponse stream | Get notified of changes to the OnOff state of a device |
OnOffInfo
Describes the capabilities of a specific named device with respect to this trait.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
DescribeOnOff | DescribeOnOffRequest | OnOffSupport | Get information about how a named device implements OnOff features |