Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.alexa.resources.AlexaSemantics Class Reference
Collaboration diagram for homeassistant.components.alexa.resources.AlexaSemantics:
[legend]

Public Member Functions

None __init__ (self)
 
None add_action_to_directive (self, list[str] actions, str directive, dict[str, Any] payload)
 
None add_states_to_range (self, list[str] states, float min_value, float max_value)
 
None add_states_to_value (self, list[str] states, Any value)
 
dict[str, Any] serialize_semantics (self)
 

Static Public Attributes

string ACTION_CLOSE = "Alexa.Actions.Close"
 
string ACTION_LOWER = "Alexa.Actions.Lower"
 
string ACTION_OPEN = "Alexa.Actions.Open"
 
string ACTION_RAISE = "Alexa.Actions.Raise"
 
string ACTIONS_TO_DIRECTIVE = "ActionsToDirective"
 
string DIRECTIVE_MODE_ADJUST_MODE = "AdjustMode"
 
string DIRECTIVE_MODE_SET_MODE = "SetMode"
 
string DIRECTIVE_RANGE_ADJUST_VALUE = "AdjustRangeValue"
 
string DIRECTIVE_RANGE_SET_VALUE = "SetRangeValue"
 
string DIRECTIVE_TOGGLE_TURN_OFF = "TurnOff"
 
string DIRECTIVE_TOGGLE_TURN_ON = "TurnOn"
 
string MAPPINGS_ACTION = "actionMappings"
 
string MAPPINGS_STATE = "stateMappings"
 
string STATES_CLOSED = "Alexa.States.Closed"
 
string STATES_OPEN = "Alexa.States.Open"
 
string STATES_TO_RANGE = "StatesToRange"
 
string STATES_TO_VALUE = "StatesToValue"
 

Private Member Functions

None _add_action_mapping (self, dict[str, Any] semantics)
 
None _add_state_mapping (self, dict[str, Any] semantics)
 

Detailed Description

Class for Alexa Semantics Object.

You can optionally enable additional utterances by using semantics. When
you use semantics, you manually map the phrases "open", "close", "raise",
and "lower" to directives.

Semantics is supported for the following interfaces only: ModeController,
RangeController, and ToggleController.

Semantics stateMappings are only supported for one interface of the same
type on the same device. If a device has multiple RangeControllers only
one interface may use stateMappings otherwise discovery will fail.

You can support semantics actionMappings on different controllers for the
same device, however each controller must support different phrases.
For example, you can support "raise" on a RangeController, and "open"
on a ModeController, but you can't support "open" on both RangeController
and ModeController. Semantics stateMappings are only supported for one
interface on the same device.

https://developer.amazon.com/docs/device-apis/alexa-discovery.html#semantics-object

Definition at line 342 of file resources.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.alexa.resources.AlexaSemantics.__init__ (   self)
Initialize an Alexa modeResource.

Definition at line 388 of file resources.py.

Member Function Documentation

◆ _add_action_mapping()

None homeassistant.components.alexa.resources.AlexaSemantics._add_action_mapping (   self,
dict[str, Any]  semantics 
)
private
Add action mapping between actions and interface directives.

Definition at line 393 of file resources.py.

◆ _add_state_mapping()

None homeassistant.components.alexa.resources.AlexaSemantics._add_state_mapping (   self,
dict[str, Any]  semantics 
)
private
Add state mapping between states and interface directives.

Definition at line 397 of file resources.py.

◆ add_action_to_directive()

None homeassistant.components.alexa.resources.AlexaSemantics.add_action_to_directive (   self,
list[str]  actions,
str  directive,
dict[str, Any]   payload 
)
Add ActionsToDirective actionMappings.

Definition at line 419 of file resources.py.

◆ add_states_to_range()

None homeassistant.components.alexa.resources.AlexaSemantics.add_states_to_range (   self,
list[str]  states,
float  min_value,
float   max_value 
)
Add StatesToRange stateMappings.

Definition at line 407 of file resources.py.

◆ add_states_to_value()

None homeassistant.components.alexa.resources.AlexaSemantics.add_states_to_value (   self,
list[str]  states,
Any  value 
)
Add StatesToValue stateMappings.

Definition at line 401 of file resources.py.

◆ serialize_semantics()

dict[str, Any] homeassistant.components.alexa.resources.AlexaSemantics.serialize_semantics (   self)
Return semantics object serialized for an API response.

Definition at line 431 of file resources.py.

Member Data Documentation

◆ ACTION_CLOSE

string homeassistant.components.alexa.resources.AlexaSemantics.ACTION_CLOSE = "Alexa.Actions.Close"
static

Definition at line 373 of file resources.py.

◆ ACTION_LOWER

string homeassistant.components.alexa.resources.AlexaSemantics.ACTION_LOWER = "Alexa.Actions.Lower"
static

Definition at line 374 of file resources.py.

◆ ACTION_OPEN

string homeassistant.components.alexa.resources.AlexaSemantics.ACTION_OPEN = "Alexa.Actions.Open"
static

Definition at line 375 of file resources.py.

◆ ACTION_RAISE

string homeassistant.components.alexa.resources.AlexaSemantics.ACTION_RAISE = "Alexa.Actions.Raise"
static

Definition at line 376 of file resources.py.

◆ ACTIONS_TO_DIRECTIVE

string homeassistant.components.alexa.resources.AlexaSemantics.ACTIONS_TO_DIRECTIVE = "ActionsToDirective"
static

Definition at line 369 of file resources.py.

◆ DIRECTIVE_MODE_ADJUST_MODE

string homeassistant.components.alexa.resources.AlexaSemantics.DIRECTIVE_MODE_ADJUST_MODE = "AdjustMode"
static

Definition at line 386 of file resources.py.

◆ DIRECTIVE_MODE_SET_MODE

string homeassistant.components.alexa.resources.AlexaSemantics.DIRECTIVE_MODE_SET_MODE = "SetMode"
static

Definition at line 385 of file resources.py.

◆ DIRECTIVE_RANGE_ADJUST_VALUE

string homeassistant.components.alexa.resources.AlexaSemantics.DIRECTIVE_RANGE_ADJUST_VALUE = "AdjustRangeValue"
static

Definition at line 382 of file resources.py.

◆ DIRECTIVE_RANGE_SET_VALUE

string homeassistant.components.alexa.resources.AlexaSemantics.DIRECTIVE_RANGE_SET_VALUE = "SetRangeValue"
static

Definition at line 381 of file resources.py.

◆ DIRECTIVE_TOGGLE_TURN_OFF

string homeassistant.components.alexa.resources.AlexaSemantics.DIRECTIVE_TOGGLE_TURN_OFF = "TurnOff"
static

Definition at line 384 of file resources.py.

◆ DIRECTIVE_TOGGLE_TURN_ON

string homeassistant.components.alexa.resources.AlexaSemantics.DIRECTIVE_TOGGLE_TURN_ON = "TurnOn"
static

Definition at line 383 of file resources.py.

◆ MAPPINGS_ACTION

string homeassistant.components.alexa.resources.AlexaSemantics.MAPPINGS_ACTION = "actionMappings"
static

Definition at line 366 of file resources.py.

◆ MAPPINGS_STATE

string homeassistant.components.alexa.resources.AlexaSemantics.MAPPINGS_STATE = "stateMappings"
static

Definition at line 367 of file resources.py.

◆ STATES_CLOSED

string homeassistant.components.alexa.resources.AlexaSemantics.STATES_CLOSED = "Alexa.States.Closed"
static

Definition at line 379 of file resources.py.

◆ STATES_OPEN

string homeassistant.components.alexa.resources.AlexaSemantics.STATES_OPEN = "Alexa.States.Open"
static

Definition at line 378 of file resources.py.

◆ STATES_TO_RANGE

string homeassistant.components.alexa.resources.AlexaSemantics.STATES_TO_RANGE = "StatesToRange"
static

Definition at line 371 of file resources.py.

◆ STATES_TO_VALUE

string homeassistant.components.alexa.resources.AlexaSemantics.STATES_TO_VALUE = "StatesToValue"
static

Definition at line 370 of file resources.py.


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