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

Public Member Functions

None __init__ (self, list[str] labels)
 
dict[str, list[dict[str, Any]]] serialize_capability_resources (self)
 
dict[str, Any] serialize_configuration (self)
 
dict[str, list[dict[str, Any]]] serialize_labels (self, list[str] resources)
 

Private Attributes

 _resource_labels
 

Detailed Description

Base class for Alexa capabilityResources, modeResources, and presetResources.

Resources objects labels must be unique across all modeResources and
presetResources within the same device. To provide support for all
supported locales, include one label from the AlexaGlobalCatalog in the
labels array.

You cannot use any words from the following list as friendly names:
https://developer.amazon.com/docs/alexa/device-apis/resources-and-assets.html#names-you-cannot-use

https://developer.amazon.com/docs/device-apis/resources-and-assets.html#capability-resources

Definition at line 198 of file resources.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.alexa.resources.AlexaCapabilityResource.__init__ (   self,
list[str]  labels 
)
Initialize an Alexa resource.

Definition at line 212 of file resources.py.

Member Function Documentation

◆ serialize_capability_resources()

dict[str, list[dict[str, Any]]] homeassistant.components.alexa.resources.AlexaCapabilityResource.serialize_capability_resources (   self)
Return capabilityResources object serialized for an API response.

Definition at line 218 of file resources.py.

◆ serialize_configuration()

dict[str, Any] homeassistant.components.alexa.resources.AlexaCapabilityResource.serialize_configuration (   self)
Return serialized configuration for an API response.

Return ModeResources, PresetResources friendlyNames serialized.

Reimplemented in homeassistant.components.alexa.resources.AlexaPresetResource, and homeassistant.components.alexa.resources.AlexaModeResource.

Definition at line 222 of file resources.py.

◆ serialize_labels()

dict[str, list[dict[str, Any]]] homeassistant.components.alexa.resources.AlexaCapabilityResource.serialize_labels (   self,
list[str]  resources 
)
Return serialized labels for an API response.

Returns resource label objects for friendlyNames serialized.

Definition at line 229 of file resources.py.

Member Data Documentation

◆ _resource_labels

homeassistant.components.alexa.resources.AlexaCapabilityResource._resource_labels
private

Definition at line 214 of file resources.py.


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