Appearance
traits/extend_retract.proto
Table of Contents
traits/extend_retract.proto
CreateExtensionPresetRequest
A request to store the current position under a preset name
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device | |
preset | ExtensionPreset | The preset to store the position under |
DescribeExtensionRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device |
ExtendRetractStopRequest
Request for the stop api
Field | Type | Label | Description |
---|---|---|---|
name | string | the name of the device to stop |
Extension
How extended the device is.
Field | Type | Label | Description |
---|---|---|---|
extend_percent | float | 0 to 100, representing the extension percentage of the device | |
extend_preset | string | A named preset for recall to extend the device to a specific point | |
extend_tween | smartcore.types.Tween | How the extension changes or should change over time. On write only duration should be set. | |
target_extend_percent | float | if tweening between values, this is our end goal | |
target_extend_preset | string | if tweening between values, this is our end goal |
ExtensionPreset
Describes a preset that may be configured on the device
Field | Type | Label | Description |
---|---|---|---|
name | string | Required. The name of the preset, to be used for recall. | |
extend_percent | float | optional | Optional 0 to 100, extension percentage that the preset would extend the device by. |
writable | bool | Can this preset be stored via the api |
ExtensionSupport
ExtensionSupport 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 | |
presets | ExtensionPreset | repeated | List of presets that this device supports. If empty then the device does not support presets |
step | float | 0 to 100, how precise is the control of the extension. A value of 0 (or 100) means only 0 or 100 extend_percent are valid. | |
tween_support | smartcore.types.TweenSupport | Does the device support tweening between the current value and a target value | |
supports_custom_presets | bool | If true, custom preset names can be used to store extension values. If false only writable presets can be updated. |
GetExtensionRequest
request to fetch the current extension for the device
Field | Type | Label | Description |
---|---|---|---|
name | string | the name of the device to fetch the information for | |
read_mask | google.protobuf.FieldMask | The state fields to fetch |
PullExtensionsRequest
A request to monitor the state of a device
Field | Type | Label | Description |
---|---|---|---|
name | string | name of the device to subscribe to | |
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. |
PullExtensionsResponse
Response to a Pull request for extension changes
Field | Type | Label | Description |
---|---|---|---|
changes | PullExtensionsResponse.Change | repeated | Changes that have occurred since the last event |
PullExtensionsResponse.Change
A change to the state
Field | Type | Label | Description |
---|---|---|---|
name | string | name for the device that issued the change | |
change_time | google.protobuf.Timestamp | when the change occurred | |
extension | Extension | the new state for the device |
UpdateExtensionRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
extension | Extension | ||
update_mask | google.protobuf.FieldMask |
ExtendRetractApi
Applicable to devices that can be extended or retracted. Like a tv mount or adjustable desk
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetExtension | GetExtensionRequest | Extension | Set the target state for the device |
UpdateExtension | UpdateExtensionRequest | Extension | Set the target state for the device |
Stop | ExtendRetractStopRequest | Extension | Stop the device if it is extending or retracting, returns the current known state after stopping. |
CreateExtensionPreset | CreateExtensionPresetRequest | ExtensionPreset | Create a preset for the extension. If no preset extension value is specified then use the current position |
PullExtensions | PullExtensionsRequest | PullExtensionsResponse stream | Get notified of changes to the OnOffState of a device |
ExtendRetractInfo
Describes the capabilities of a specific named device with respect to this trait.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
DescribeExtension | DescribeExtensionRequest | ExtensionSupport | Get information about how a named device implements Extension features |