Channel Trait
API Service: ChannelApi
ChannelApi allows for querying and updating the chosen channel on a device like a TV.
Method | Request Type | Response Type | Description |
---|---|---|---|
GetChosenChannel | GetChosenChannelRequest | Channel | GetChosenChannel returns the currently chosen channel for the device. |
ChooseChannel | ChooseChannelRequest | Channel | ChooseChannel will set the currently chosen channel to the one specified. Returns the chosen channel |
AdjustChannel | AdjustChannelRequest | Channel | AdjustChannel will choose a channel based on the current channel, i.e. 'next channel'. Returns the chosen channel |
ReturnChannel | ReturnChannelRequest | Channel | ReturnChannel will choose the previously chosen channel. Returns the chosen channel |
PullChosenChannel | PullChosenChannelRequest | PullChosenChannelResponse stream | PullChosenChannel subscribes to chosen channel changes |
Info Service: ChannelInfo
Describes the capabilities of a specific named device with respect to this trait.
Method | Request Type | Response Type | Description |
---|---|---|---|
DescribeChosenChannel | DescribeChosenChannelRequest | ChosenChannelSupport | Get information about how a named device implements channel choosing and adjustment |
Channel
Channel describes a single channel that can be chosen on the device.
During read all known properties will be populated, id and title will always be present. On write either id or number must be present.
Field Name | Type | Description |
---|---|---|
id | string | Id uniquely identifies the channel and can be used to select it explicitly. |
channel_number | string | A numeric identifier for the channel, such as 17 or 712.11-14. Not always parsable as a number. |
title | string | A human readable name for the channel. |
ChosenChannelSupport
ChosenChannelSupport describes the capabilities of devices implementing this trait
Field Name | Type | Description |
---|---|---|
resource_support | smartcore.types.ResourceSupport | How a named device supports read/write/pull apis |
adjust_max | int32 | The max number of channels away from the current that are supported when adjusting channels. Defaults to 1. |
GetChosenChannelRequest
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |
read_mask | google.protobuf.FieldMask | The state fields to fetch |
ChooseChannelRequest
ChooseChannelRequest describes which channel to select.
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |
channel | Channel | The channel to select. Must contain either id or number. |
AdjustChannelRequest
AdjustChannelRequest describes how to change the channel relative to the current channel.
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |
amount | int32 | How many channels to skip, use negative numbers to select previous channels. See ChannelApiAttributes.adjust_max. |
ReturnChannelRequest
Select the last channel to be selected before the current one.
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |
PullChosenChannelRequest
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |
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. |
PullChosenChannelResponse
Field Name | Type | Description |
---|---|---|
changes | repeated PullChosenChannelResponse.Change |
PullChosenChannelResponse.Change
Field Name | Type | Description |
---|---|---|
name | string | name for the device that issued the change |
change_time | google.protobuf.Timestamp | when the change occurred |
chosen_channel | Channel | The new chosen channel |
DescribeChosenChannelRequest
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |