mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Guard against non supported entities (#26941)
This commit is contained in:
committed by
Pascal Vizeli
parent
9f6fade236
commit
fc700c7937
@@ -131,6 +131,10 @@ async def async_send_add_or_update_message(hass, config, entity_ids):
|
||||
|
||||
for entity_id in entity_ids:
|
||||
domain = entity_id.split(".", 1)[0]
|
||||
|
||||
if domain not in ENTITY_ADAPTERS:
|
||||
continue
|
||||
|
||||
alexa_entity = ENTITY_ADAPTERS[domain](hass, config, hass.states.get(entity_id))
|
||||
endpoints.append(alexa_entity.serialize_discovery())
|
||||
|
||||
@@ -161,6 +165,10 @@ async def async_send_delete_message(hass, config, entity_ids):
|
||||
|
||||
for entity_id in entity_ids:
|
||||
domain = entity_id.split(".", 1)[0]
|
||||
|
||||
if domain not in ENTITY_ADAPTERS:
|
||||
continue
|
||||
|
||||
alexa_entity = ENTITY_ADAPTERS[domain](hass, config, hass.states.get(entity_id))
|
||||
endpoints.append({"endpointId": alexa_entity.alexa_id()})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user