Speaker Trait
API Service: SpeakerApi
Trait for devices that support some kind of audio output. The most basic is a simple on/off speaker, it's optional to support volume adjustment on a scale.
For the sakes of this trait "volume" means the combination of a gain and a mute state.
Method | Request Type | Response Type | Description |
---|---|---|---|
GetVolume | GetSpeakerVolumeRequest | smartcore.types.AudioLevel | Get the current state of the volume for the device |
UpdateVolume | UpdateSpeakerVolumeRequest | smartcore.types.AudioLevel | update the volume state for the device |
PullVolume | PullSpeakerVolumeRequest | PullSpeakerVolumeResponse stream |
Info Service: SpeakerInfo
Describes the capabilities of a specific named device with respect to this trait.
Method | Request Type | Response Type | Description |
---|---|---|---|
DescribeVolume | DescribeVolumeRequest | VolumeSupport | Get information about how a named device implements volume features |
VolumeSupport
VolumeSupport 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 |
volume_attributes | smartcore.types.FloatAttributes | Attributes associated with the gain property of the speaker. Note that a step value that is the same as the bounds implies that the speaker only supports mute |
mute_support | smartcore.types.MuteSupport | How is mute implemented by the device. Can help to customise behaviour of interfaces to the device, e.g. by disallowing gain change when muted |
GetSpeakerVolumeRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device to fetch the state for |
read_mask | google.protobuf.FieldMask | fields to fetch relative the the AudioLevel type |
UpdateSpeakerVolumeRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device to update the state for |
volume | smartcore.types.AudioLevel | The updated volume value |
delta | bool | Only supported for AudioLevel.gain. Update the value relative to the current value. |
update_mask | google.protobuf.FieldMask | The fields we intend to update relative to the AudioLevel type |
PullSpeakerVolumeRequest
Field Name | Type | Description |
---|---|---|
name | string | Name of the device to fetch the state for |
read_mask | google.protobuf.FieldMask | fields to fetch relative the the AudioLevel type |
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. |
PullSpeakerVolumeResponse
Field Name | Type | Description |
---|---|---|
changes | repeated smartcore.types.AudioLevelChange | Changes since the last message |
DescribeVolumeRequest
Field Name | Type | Description |
---|---|---|
name | string | The name of the device |