diff --git a/homeassistant/components/cloud/alexa_config.py b/homeassistant/components/cloud/alexa_config.py index bfdd2e560a5..4ba32c338b5 100644 --- a/homeassistant/components/cloud/alexa_config.py +++ b/homeassistant/components/cloud/alexa_config.py @@ -24,7 +24,6 @@ from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.homeassistant.exposed_entities import ( async_expose_entity, async_get_assistant_settings, - async_get_entity_settings, async_listen_entity_updates, async_should_expose, ) @@ -201,10 +200,6 @@ class CloudAlexaConfig(alexa_config.AbstractConfig): return for state in self.hass.states.async_all(): - with suppress(HomeAssistantError): - entity_settings = async_get_entity_settings(self.hass, state.entity_id) - if CLOUD_ALEXA in entity_settings: - continue async_expose_entity( self.hass, CLOUD_ALEXA, @@ -212,10 +207,6 @@ class CloudAlexaConfig(alexa_config.AbstractConfig): self._should_expose_legacy(state.entity_id), ) for entity_id in self._prefs.alexa_entity_configs: - with suppress(HomeAssistantError): - entity_settings = async_get_entity_settings(self.hass, entity_id) - if CLOUD_ALEXA in entity_settings: - continue async_expose_entity( self.hass, CLOUD_ALEXA, diff --git a/homeassistant/components/cloud/google_config.py b/homeassistant/components/cloud/google_config.py index dae1c00a33f..16848acc19d 100644 --- a/homeassistant/components/cloud/google_config.py +++ b/homeassistant/components/cloud/google_config.py @@ -1,6 +1,5 @@ """Google config for Cloud.""" import asyncio -from contextlib import suppress from http import HTTPStatus import logging from typing import Any @@ -178,10 +177,6 @@ class CloudGoogleConfig(AbstractConfig): for state in self.hass.states.async_all(): entity_id = state.entity_id - with suppress(HomeAssistantError): - entity_settings = async_get_entity_settings(self.hass, entity_id) - if CLOUD_GOOGLE in entity_settings: - continue async_expose_entity( self.hass, CLOUD_GOOGLE, @@ -197,10 +192,6 @@ class CloudGoogleConfig(AbstractConfig): _2fa_disabled, ) for entity_id in self._prefs.google_entity_configs: - with suppress(HomeAssistantError): - entity_settings = async_get_entity_settings(self.hass, entity_id) - if CLOUD_GOOGLE in entity_settings: - continue async_expose_entity( self.hass, CLOUD_GOOGLE, diff --git a/tests/components/cloud/test_alexa_config.py b/tests/components/cloud/test_alexa_config.py index 2a4be7e1645..3a7e5a0874e 100644 --- a/tests/components/cloud/test_alexa_config.py +++ b/tests/components/cloud/test_alexa_config.py @@ -628,7 +628,7 @@ async def test_alexa_config_migrate_expose_entity_prefs( "cloud.alexa": {"should_expose": True} } assert async_get_entity_settings(hass, entity_migrated.entity_id) == { - "cloud.alexa": {"should_expose": False} + "cloud.alexa": {"should_expose": True} } assert async_get_entity_settings(hass, entity_config.entity_id) == { "cloud.alexa": {"should_expose": False} diff --git a/tests/components/cloud/test_google_config.py b/tests/components/cloud/test_google_config.py index 0fa37ed9987..45bc56a1700 100644 --- a/tests/components/cloud/test_google_config.py +++ b/tests/components/cloud/test_google_config.py @@ -580,7 +580,7 @@ async def test_google_config_migrate_expose_entity_prefs( "cloud.google_assistant": {"should_expose": True} } assert async_get_entity_settings(hass, entity_migrated.entity_id) == { - "cloud.google_assistant": {"should_expose": False} + "cloud.google_assistant": {"should_expose": True} } assert async_get_entity_settings(hass, entity_no_2fa_exposed.entity_id) == { "cloud.google_assistant": {"disable_2fa": True, "should_expose": True}