Notify Alexa when exposed entities change (#24609)
This commit is contained in:
parent
a89c8eeabe
commit
6d9f1b3fd3
12 changed files with 436 additions and 68 deletions
|
@ -168,6 +168,20 @@ class AlexaEntity:
|
|||
for prop in interface.serialize_properties():
|
||||
yield prop
|
||||
|
||||
def serialize_discovery(self):
|
||||
"""Serialize the entity for discovery."""
|
||||
return {
|
||||
'displayCategories': self.display_categories(),
|
||||
'cookie': {},
|
||||
'endpointId': self.alexa_id(),
|
||||
'friendlyName': self.friendly_name(),
|
||||
'description': self.description(),
|
||||
'manufacturerName': 'Home Assistant',
|
||||
'capabilities': [
|
||||
i.serialize_discovery() for i in self.interfaces()
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@callback
|
||||
def async_get_entities(hass, config) -> List[AlexaEntity]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue