Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.alexa.state_report.AlexaDirective Class Reference

Public Member Functions

None __init__ (self, dict[str, Any] request)
 
AlexaResponse error (self, str namespace="Alexa", str error_type="INTERNAL_ERROR", str error_message="", dict[str, Any]|None payload=None)
 
None load_entity (self, HomeAssistant hass, AbstractConfig config)
 
AlexaResponse response (self, str name="Response", str namespace="Alexa", dict[str, Any]|None payload=None)
 

Public Attributes

 endpoint
 
 entity
 
 entity_id
 
 instance
 

Detailed Description

An incoming Alexa directive.

Definition at line 56 of file state_report.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.alexa.state_report.AlexaDirective.__init__ (   self,
dict[str, Any]  request 
)
Initialize a directive.

Definition at line 64 of file state_report.py.

Member Function Documentation

◆ error()

AlexaResponse homeassistant.components.alexa.state_report.AlexaDirective.error (   self,
str   namespace = "Alexa",
str   error_type = "INTERNAL_ERROR",
str   error_message = "",
dict[str, Any] | None   payload = None 
)
Create a API formatted error response.

Async friendly.

Definition at line 122 of file state_report.py.

◆ load_entity()

None homeassistant.components.alexa.state_report.AlexaDirective.load_entity (   self,
HomeAssistant  hass,
AbstractConfig  config 
)
Set attributes related to the entity for this request.

Sets these attributes when self.has_endpoint is True:

- entity
- entity_id
- endpoint
- instance (when header includes instance property)

Behavior when self.has_endpoint is False is undefined.

Will raise AlexaInvalidEndpointError if the endpoint in the request is
malformed or nonexistent.

Definition at line 74 of file state_report.py.

◆ response()

AlexaResponse homeassistant.components.alexa.state_report.AlexaDirective.response (   self,
str   name = "Response",
str   namespace = "Alexa",
dict[str, Any] | None   payload = None 
)
Create an API formatted response.

Async friendly.

Definition at line 101 of file state_report.py.

Member Data Documentation

◆ endpoint

homeassistant.components.alexa.state_report.AlexaDirective.endpoint

Definition at line 97 of file state_report.py.

◆ entity

homeassistant.components.alexa.state_report.AlexaDirective.entity

Definition at line 95 of file state_report.py.

◆ entity_id

homeassistant.components.alexa.state_report.AlexaDirective.entity_id

Definition at line 72 of file state_report.py.

◆ instance

homeassistant.components.alexa.state_report.AlexaDirective.instance

Definition at line 71 of file state_report.py.


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