diff --git a/homeassistant/components/cloud/http_api.py b/homeassistant/components/cloud/http_api.py index 391726cb900..b0878fd24aa 100644 --- a/homeassistant/components/cloud/http_api.py +++ b/homeassistant/components/cloud/http_api.py @@ -618,14 +618,11 @@ async def google_assistant_list( """List all google assistant entities.""" cloud = hass.data[DOMAIN] gconf = await cloud.client.get_google_config() - entity_registry = er.async_get(hass) entities = google_helpers.async_get_entities(hass, gconf) result = [] for entity in entities: - if not entity_registry.async_is_registered(entity.entity_id): - continue result.append( { "entity_id": entity.entity_id, @@ -724,14 +721,11 @@ async def alexa_list( """List all alexa entities.""" cloud = hass.data[DOMAIN] alexa_config = await cloud.client.get_alexa_config() - entity_registry = er.async_get(hass) entities = alexa_entities.async_get_entities(hass, alexa_config) result = [] for entity in entities: - if not entity_registry.async_is_registered(entity.entity_id): - continue result.append( { "entity_id": entity.entity_id, diff --git a/tests/components/cloud/test_http_api.py b/tests/components/cloud/test_http_api.py index f497c2c108e..3e7523cc02c 100644 --- a/tests/components/cloud/test_http_api.py +++ b/tests/components/cloud/test_http_api.py @@ -762,7 +762,17 @@ async def test_list_google_entities( await client.send_json_auto_id({"type": "cloud/google_assistant/entities"}) response = await client.receive_json() assert response["success"] - assert len(response["result"]) == 0 + assert len(response["result"]) == 2 + assert response["result"][0] == { + "entity_id": "light.kitchen", + "might_2fa": False, + "traits": ["action.devices.traits.OnOff"], + } + assert response["result"][1] == { + "entity_id": "cover.garage", + "might_2fa": True, + "traits": ["action.devices.traits.OpenClose"], + } # Add the entities to the entity registry entity_registry.async_get_or_create( @@ -939,7 +949,12 @@ async def test_list_alexa_entities( await client.send_json_auto_id({"id": 5, "type": "cloud/alexa/entities"}) response = await client.receive_json() assert response["success"] - assert len(response["result"]) == 0 + assert len(response["result"]) == 1 + assert response["result"][0] == { + "entity_id": "light.kitchen", + "display_categories": ["LIGHT"], + "interfaces": ["Alexa.PowerController", "Alexa.EndpointHealth", "Alexa"], + } # Add the entity to the entity registry entity_registry.async_get_or_create(