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) |
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.
| None homeassistant.components.alexa.resources.AlexaSemantics.__init__ | ( | self | ) |
Initialize an Alexa modeResource.
Definition at line 388 of file resources.py.
|
private |
Add action mapping between actions and interface directives.
Definition at line 393 of file resources.py.
|
private |
Add state mapping between states and interface directives.
Definition at line 397 of file resources.py.
| 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.
| 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.
| 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.
| 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.
|
static |
Definition at line 373 of file resources.py.
|
static |
Definition at line 374 of file resources.py.
|
static |
Definition at line 375 of file resources.py.
|
static |
Definition at line 376 of file resources.py.
|
static |
Definition at line 369 of file resources.py.
|
static |
Definition at line 386 of file resources.py.
|
static |
Definition at line 385 of file resources.py.
|
static |
Definition at line 382 of file resources.py.
|
static |
Definition at line 381 of file resources.py.
|
static |
Definition at line 384 of file resources.py.
|
static |
Definition at line 383 of file resources.py.
|
static |
Definition at line 366 of file resources.py.
|
static |
Definition at line 367 of file resources.py.
|
static |
Definition at line 379 of file resources.py.
|
static |
Definition at line 378 of file resources.py.
|
static |
Definition at line 371 of file resources.py.
|
static |
Definition at line 370 of file resources.py.