Chromecast

Represents a Chromecast, Chromecast Audio, or a Google Home device.

class aaa_modules.chromecast.ChromeCast(prefix, sinkName)[source]

Ctor.

Parameters:
  • prefix (str) – the item name prefix, as defined in the .item file. By convention, other channels of this device will have this naming pattern: {prefix}Idling, {prefix}Title, {prefix}Player, and so on.
  • sinkName (str) – the sink name for voice and audio play. The sink name can be retrieved by running “openhab-cli console” and then “smarthome:audio sinks”.
getIdleItemName()[source]

Returns the name of the player item for this chromecast object.

Return type:str
getLastTtsMessage()[source]
Return type:str
getPlayerName()[source]

Returns the name of the player item for this chromecast object.

Return type:str
getPrefix()[source]
Return type:str
getSinkName()[source]

Return the sink name for Voice.say and Audio.playStream usages.

Return type:str
getStreamName()[source]

Returns the current stream name or None if no stream set.

Return type:str
getStreamUrl()[source]

Returns the current stream Uri or None if no stream set.

Return type:str
getVolumeName()[source]

Returns the name of the volume item for this chromecast object.

Return type:str
hasTitle()[source]
Return type:bool
isActive()[source]

Return true if the the chromecast is playing something.

Parameters:castItemPrefix (str) – the chrome cast item name
setStream(streamName, streamUrl)[source]

Associate a stream URI with this object.

Parameters:
  • streamUrl (str) –
  • streamName (str) –