Appearance
traits/color.proto
Table of Contents
traits/color.proto
Color
Represents the color
Field | Type | Label | Description |
---|---|---|---|
channels | ColorChannels | ||
preset | ColorPreset | ||
color_tween | smartcore.types.Tween | How the color changes or should change over time. On write only duration should be set. | |
target_channels | ColorChannels | The target channel values. Ignored on write. On read zero values should be ignored iff target_preset is present. | |
target_preset | ColorPreset | The target preset. Ignored on write. If present ignore target_channels |
ColorChannels
ColorChannels represents different channels of color for a device, e.g. red, green, and blue
Field | Type | Label | Description |
---|---|---|---|
red | uint32 | optional | red channel value in the range [0,255] optional on write, required on read if supported |
green | uint32 | optional | green channel value in the range [0,255] optional on write, required on read if supported |
blue | uint32 | optional | blue channel value in the range [0,255] optional on write, required on read if supported |
intensity | uint32 | optional | if the device supports an intensity channel, that is represented here in the range [0,255] optional on write, required on read if supported |
temperature | uint32 | optional | if the device supports color temperature, that is represented here in Kelvin, typically in the range [2000,9000] optional on write, required on read if supported |
more | ColorChannels.MoreEntry | repeated | a map of other channel names to value, where the value is [0-255] all values supported (that aren't specific fields above) should be present in the map, even if the value is 0; except on write when values not to be changed should be omitted e.g. if a device supports RGBW (red, green, blue, and white), then this map should contain the white value: {more: {white: 255}} |
ColorChannels.MoreEntry
Field | Type | Label | Description |
---|---|---|---|
key | string | ||
value | uint32 |
ColorPreset
Field | Type | Label | Description |
---|---|---|---|
name | string | a unique name for this preset, which could be a number or ID, e.g. "143", or "preset_1" | |
title | string | a display name for this preset, e.g. "Wake Up", or "Film Mode" |
ColorSupport
ColorSupport 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 | |
color_attributes | smartcore.types.Int32Attributes | control how the color can be controlled. The range of these attributes is fixed at 0-100 as a percentage | |
presets | ColorPreset | repeated | A description of the supported presets, none means no presets |
channels | string | repeated | A description of the supported channels, none means no channels this would include "red", "green", "blue", "intensity" and "temperature" as appropriate, as well as any other channels |
DescribeColorRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device |
GetColorRequest
A request to get the current value of a color
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device to get the value for | |
read_mask | google.protobuf.FieldMask | The state fields to fetch |
PullColorRequest
Request to begin a subscription for color values
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device we want events from | |
exclude_ramping | bool | Indicate whether we want to be notified of values while ramping or not. The device may ignore this depending on capabilities | |
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. |
PullColorResponse
A response as part of the stream of changes to the color value
Field | Type | Label | Description |
---|---|---|---|
changes | PullColorResponse.Change | repeated | The list of changes |
PullColorResponse.Change
A change to a single devices color value
Field | Type | Label | Description |
---|---|---|---|
name | string | name for the device that issued the change | |
change_time | google.protobuf.Timestamp | when the change occurred | |
color | Color | The new value for the color |
UpdateColorRequest
A request to update the value of a color
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device to update | |
color | Color | The new value for the color. Supply ramp to transition | |
update_mask | google.protobuf.FieldMask | The state fields to update |
ColorApi
Control the color of a device. This could be a smart-bulb, or a DMX fitting.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetColor | GetColorRequest | Color | get the current color |
UpdateColor | UpdateColorRequest | Color | request that the color be changed |
PullColor | PullColorRequest | PullColorResponse stream | request updates to changes to the color value |
ColorInfo
Describes the capabilities of a specific named device with respect to this trait.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
DescribeColor | DescribeColorRequest | ColorSupport | Get information about how a named device implements Color features |