Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.google_assistant.trait.MediaStateTrait Class Reference
Inheritance diagram for homeassistant.components.google_assistant.trait.MediaStateTrait:
[legend]
Collaboration diagram for homeassistant.components.google_assistant.trait.MediaStateTrait:
[legend]

Public Member Functions

dict[str, Any] query_attributes (self)
 
dict[str, Any] sync_attributes (self)
 
- Public Member Functions inherited from homeassistant.components.google_assistant.trait._Trait
None __init__ (self, HomeAssistant hass, state, config)
 
def can_execute (self, command, params)
 
def execute (self, command, data, params, challenge)
 
dict[str, Any]|None query_notifications (self)
 
dict[str, Any] sync_options (self)
 

Static Public Member Functions

def supported (domain, features, device_class, _)
 
- Static Public Member Functions inherited from homeassistant.components.google_assistant.trait._Trait
def might_2fa (domain, features, device_class)
 

Static Public Attributes

dictionary activity_lookup
 
 name = TRAIT_MEDIA_STATE
 
dictionary playback_lookup
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.google_assistant.trait._Trait
 config
 
 hass
 
 state
 

Detailed Description

Trait to get media playback state.

https://developers.google.com/actions/smarthome/traits/mediastate

Definition at line 2586 of file trait.py.

Member Function Documentation

◆ query_attributes()

dict[str, Any] homeassistant.components.google_assistant.trait.MediaStateTrait.query_attributes (   self)
Return the attributes of this trait for this entity.

Reimplemented from homeassistant.components.google_assistant.trait._Trait.

Definition at line 2626 of file trait.py.

◆ supported()

def homeassistant.components.google_assistant.trait.MediaStateTrait.supported (   domain,
  features,
  device_class,
  _ 
)
static
Test if state is supported.

Reimplemented from homeassistant.components.google_assistant.trait._Trait.

Definition at line 2618 of file trait.py.

◆ sync_attributes()

dict[str, Any] homeassistant.components.google_assistant.trait.MediaStateTrait.sync_attributes (   self)
Return attributes for a sync request.

Reimplemented from homeassistant.components.google_assistant.trait._Trait.

Definition at line 2622 of file trait.py.

Member Data Documentation

◆ activity_lookup

dictionary homeassistant.components.google_assistant.trait.MediaStateTrait.activity_lookup
static
Initial value:
= {
STATE_OFF: "INACTIVE",
STATE_IDLE: "STANDBY",
STATE_PLAYING: "ACTIVE",
STATE_ON: "STANDBY",
STATE_PAUSED: "STANDBY",
STATE_STANDBY: "STANDBY",
STATE_UNAVAILABLE: "INACTIVE",
STATE_UNKNOWN: "INACTIVE",
}

Definition at line 2595 of file trait.py.

◆ name

homeassistant.components.google_assistant.trait.MediaStateTrait.name = TRAIT_MEDIA_STATE
static

Definition at line 2592 of file trait.py.

◆ playback_lookup

dictionary homeassistant.components.google_assistant.trait.MediaStateTrait.playback_lookup
static
Initial value:
= {
STATE_OFF: "STOPPED",
STATE_IDLE: "STOPPED",
STATE_PLAYING: "PLAYING",
STATE_ON: "STOPPED",
STATE_PAUSED: "PAUSED",
STATE_STANDBY: "STOPPED",
STATE_UNAVAILABLE: "STOPPED",
STATE_UNKNOWN: "STOPPED",
}

Definition at line 2606 of file trait.py.


The documentation for this class was generated from the following file: