From f3facac0168666c24ae3e85d0bcdd516de15acce Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:46:04 +0200 Subject: [PATCH] Move homematicip_cloud base entity to separate module (#126094) * Move homematicip_cloud base entity to separate module * One more --- .../components/homematicip_cloud/__init__.py | 3 +- .../homematicip_cloud/alarm_control_panel.py | 8 +-- .../homematicip_cloud/binary_sensor.py | 7 +-- .../components/homematicip_cloud/button.py | 5 +- .../components/homematicip_cloud/climate.py | 9 ++-- .../components/homematicip_cloud/cover.py | 5 +- .../{generic_entity.py => entity.py} | 6 +-- .../components/homematicip_cloud/helpers.py | 2 +- .../components/homematicip_cloud/light.py | 5 +- .../components/homematicip_cloud/lock.py | 5 +- .../components/homematicip_cloud/sensor.py | 5 +- .../components/homematicip_cloud/services.py | 50 +++++++++---------- .../components/homematicip_cloud/switch.py | 6 +-- .../components/homematicip_cloud/weather.py | 5 +- tests/components/homematicip_cloud/helper.py | 2 +- .../homematicip_cloud/test_binary_sensor.py | 2 +- .../homematicip_cloud/test_sensor.py | 2 +- .../homematicip_cloud/test_switch.py | 2 +- 18 files changed, 68 insertions(+), 61 deletions(-) rename homeassistant/components/homematicip_cloud/{generic_entity.py => entity.py} (98%) diff --git a/homeassistant/components/homematicip_cloud/__init__.py b/homeassistant/components/homematicip_cloud/__init__.py index 08002bc551a5a8..c59a9d788b3b07 100644 --- a/homeassistant/components/homematicip_cloud/__init__.py +++ b/homeassistant/components/homematicip_cloud/__init__.py @@ -21,8 +21,7 @@ HMIPC_HAPID, HMIPC_NAME, ) -from .generic_entity import HomematicipGenericEntity # noqa: F401 -from .hap import HomematicipAuth, HomematicipHAP # noqa: F401 +from .hap import HomematicipHAP from .services import async_setup_services, async_unload_services CONFIG_SCHEMA = vol.Schema( diff --git a/homeassistant/components/homematicip_cloud/alarm_control_panel.py b/homeassistant/components/homematicip_cloud/alarm_control_panel.py index e1684c34e4e0c8..35aa321f2a86c9 100644 --- a/homeassistant/components/homematicip_cloud/alarm_control_panel.py +++ b/homeassistant/components/homematicip_cloud/alarm_control_panel.py @@ -21,7 +21,7 @@ from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN +from .const import DOMAIN from .hap import AsyncHome, HomematicipHAP _LOGGER = logging.getLogger(__name__) @@ -35,7 +35,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP alrm control panel from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] async_add_entities([HomematicipAlarmControlPanelEntity(hap)]) @@ -57,11 +57,11 @@ def __init__(self, hap: HomematicipHAP) -> None: def device_info(self) -> DeviceInfo: """Return device specific attributes.""" return DeviceInfo( - identifiers={(HMIPC_DOMAIN, f"ACP {self._home.id}")}, + identifiers={(DOMAIN, f"ACP {self._home.id}")}, manufacturer="eQ-3", model=CONST_ALARM_CONTROL_PANEL_NAME, name=self.name, - via_device=(HMIPC_DOMAIN, self._home.id), + via_device=(DOMAIN, self._home.id), ) @property diff --git a/homeassistant/components/homematicip_cloud/binary_sensor.py b/homeassistant/components/homematicip_cloud/binary_sensor.py index 29d8576f06039c..38590e4505bcc6 100644 --- a/homeassistant/components/homematicip_cloud/binary_sensor.py +++ b/homeassistant/components/homematicip_cloud/binary_sensor.py @@ -39,7 +39,8 @@ from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP ATTR_ACCELERATION_SENSOR_MODE = "acceleration_sensor_mode" @@ -78,7 +79,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP Cloud binary sensor from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] entities: list[HomematicipGenericEntity] = [HomematicipCloudConnectionSensor(hap)] for device in hap.home.devices: if isinstance(device, AsyncAccelerationSensor): @@ -168,7 +169,7 @@ def device_info(self) -> DeviceInfo: return DeviceInfo( identifiers={ # Serial numbers of Homematic IP device - (HMIPC_DOMAIN, self._home.id) + (DOMAIN, self._home.id) } ) diff --git a/homeassistant/components/homematicip_cloud/button.py b/homeassistant/components/homematicip_cloud/button.py index c2707f68a89085..244be47d7f6538 100644 --- a/homeassistant/components/homematicip_cloud/button.py +++ b/homeassistant/components/homematicip_cloud/button.py @@ -9,7 +9,8 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP @@ -19,7 +20,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP button from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] async_add_entities( HomematicipGarageDoorControllerButton(hap, device) diff --git a/homeassistant/components/homematicip_cloud/climate.py b/homeassistant/components/homematicip_cloud/climate.py index dd89efed1c948c..f6a69f50770e34 100644 --- a/homeassistant/components/homematicip_cloud/climate.py +++ b/homeassistant/components/homematicip_cloud/climate.py @@ -31,7 +31,8 @@ from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP HEATING_PROFILES = {"PROFILE_1": 0, "PROFILE_2": 1, "PROFILE_3": 2} @@ -59,7 +60,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP climate from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] async_add_entities( HomematicipHeatingGroup(hap, device) @@ -94,11 +95,11 @@ def __init__(self, hap: HomematicipHAP, device: AsyncHeatingGroup) -> None: def device_info(self) -> DeviceInfo: """Return device specific attributes.""" return DeviceInfo( - identifiers={(HMIPC_DOMAIN, self._device.id)}, + identifiers={(DOMAIN, self._device.id)}, manufacturer="eQ-3", model=self._device.modelType, name=self._device.label, - via_device=(HMIPC_DOMAIN, self._device.homeId), + via_device=(DOMAIN, self._device.homeId), ) @property diff --git a/homeassistant/components/homematicip_cloud/cover.py b/homeassistant/components/homematicip_cloud/cover.py index b0cff8b6a107b3..1db536afd4fb25 100644 --- a/homeassistant/components/homematicip_cloud/cover.py +++ b/homeassistant/components/homematicip_cloud/cover.py @@ -25,7 +25,8 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP HMIP_COVER_OPEN = 0 @@ -40,7 +41,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP cover from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] entities: list[HomematicipGenericEntity] = [ HomematicipCoverShutterGroup(hap, group) for group in hap.home.groups diff --git a/homeassistant/components/homematicip_cloud/generic_entity.py b/homeassistant/components/homematicip_cloud/entity.py similarity index 98% rename from homeassistant/components/homematicip_cloud/generic_entity.py rename to homeassistant/components/homematicip_cloud/entity.py index 276177420eda19..82d682b9910504 100644 --- a/homeassistant/components/homematicip_cloud/generic_entity.py +++ b/homeassistant/components/homematicip_cloud/entity.py @@ -15,7 +15,7 @@ from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity -from .const import DOMAIN as HMIPC_DOMAIN +from .const import DOMAIN from .hap import AsyncHome, HomematicipHAP _LOGGER = logging.getLogger(__name__) @@ -104,14 +104,14 @@ def device_info(self) -> DeviceInfo | None: return DeviceInfo( identifiers={ # Serial numbers of Homematic IP device - (HMIPC_DOMAIN, self._device.id) + (DOMAIN, self._device.id) }, manufacturer=self._device.oem, model=self._device.modelType, name=self._device.label, sw_version=self._device.firmwareVersion, # Link to the homematic ip access point. - via_device=(HMIPC_DOMAIN, self._device.homeId), + via_device=(DOMAIN, self._device.homeId), ) return None diff --git a/homeassistant/components/homematicip_cloud/helpers.py b/homeassistant/components/homematicip_cloud/helpers.py index 5b7f98ad88434c..9959b993a6cdd9 100644 --- a/homeassistant/components/homematicip_cloud/helpers.py +++ b/homeassistant/components/homematicip_cloud/helpers.py @@ -13,7 +13,7 @@ from homeassistant.exceptions import HomeAssistantError -from . import HomematicipGenericEntity +from .entity import HomematicipGenericEntity _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/homematicip_cloud/light.py b/homeassistant/components/homematicip_cloud/light.py index 17daafc589692d..5a56ae6937710d 100644 --- a/homeassistant/components/homematicip_cloud/light.py +++ b/homeassistant/components/homematicip_cloud/light.py @@ -30,7 +30,8 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP @@ -40,7 +41,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP Cloud lights from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] entities: list[HomematicipGenericEntity] = [] for device in hap.home.devices: if isinstance(device, AsyncBrandSwitchMeasuring): diff --git a/homeassistant/components/homematicip_cloud/lock.py b/homeassistant/components/homematicip_cloud/lock.py index cf98828598f31b..b00f42fc844837 100644 --- a/homeassistant/components/homematicip_cloud/lock.py +++ b/homeassistant/components/homematicip_cloud/lock.py @@ -13,7 +13,8 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .helpers import handle_errors _LOGGER = logging.getLogger(__name__) @@ -39,7 +40,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP locks from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] async_add_entities( HomematicipDoorLockDrive(hap, device) diff --git a/homeassistant/components/homematicip_cloud/sensor.py b/homeassistant/components/homematicip_cloud/sensor.py index 1f76c6cce1f2d2..a9c046e25bfb66 100644 --- a/homeassistant/components/homematicip_cloud/sensor.py +++ b/homeassistant/components/homematicip_cloud/sensor.py @@ -53,7 +53,8 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import StateType -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP from .helpers import get_channels_from_device @@ -91,7 +92,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP Cloud sensors from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] entities: list[HomematicipGenericEntity] = [] for device in hap.home.devices: if isinstance(device, AsyncHomeControlAccessPoint): diff --git a/homeassistant/components/homematicip_cloud/services.py b/homeassistant/components/homematicip_cloud/services.py index 4c04e4a858b704..69765ccc601884 100644 --- a/homeassistant/components/homematicip_cloud/services.py +++ b/homeassistant/components/homematicip_cloud/services.py @@ -21,7 +21,7 @@ verify_domain_control, ) -from .const import DOMAIN as HMIPC_DOMAIN +from .const import DOMAIN _LOGGER = logging.getLogger(__name__) @@ -122,10 +122,10 @@ async def async_setup_services(hass: HomeAssistant) -> None: """Set up the HomematicIP Cloud services.""" - if hass.services.async_services_for_domain(HMIPC_DOMAIN): + if hass.services.async_services_for_domain(DOMAIN): return - @verify_domain_control(hass, HMIPC_DOMAIN) + @verify_domain_control(hass, DOMAIN) async def async_call_hmipc_service(service: ServiceCall) -> None: """Call correct HomematicIP Cloud service.""" service_name = service.service @@ -150,42 +150,42 @@ async def async_call_hmipc_service(service: ServiceCall) -> None: await _async_set_home_cooling_mode(hass, service) hass.services.async_register( - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_ACTIVATE_ECO_MODE_WITH_DURATION, service_func=async_call_hmipc_service, schema=SCHEMA_ACTIVATE_ECO_MODE_WITH_DURATION, ) hass.services.async_register( - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_ACTIVATE_ECO_MODE_WITH_PERIOD, service_func=async_call_hmipc_service, schema=SCHEMA_ACTIVATE_ECO_MODE_WITH_PERIOD, ) hass.services.async_register( - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_ACTIVATE_VACATION, service_func=async_call_hmipc_service, schema=SCHEMA_ACTIVATE_VACATION, ) hass.services.async_register( - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_DEACTIVATE_ECO_MODE, service_func=async_call_hmipc_service, schema=SCHEMA_DEACTIVATE_ECO_MODE, ) hass.services.async_register( - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_DEACTIVATE_VACATION, service_func=async_call_hmipc_service, schema=SCHEMA_DEACTIVATE_VACATION, ) hass.services.async_register( - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_SET_ACTIVE_CLIMATE_PROFILE, service_func=async_call_hmipc_service, schema=SCHEMA_SET_ACTIVE_CLIMATE_PROFILE, @@ -193,7 +193,7 @@ async def async_call_hmipc_service(service: ServiceCall) -> None: async_register_admin_service( hass=hass, - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_DUMP_HAP_CONFIG, service_func=async_call_hmipc_service, schema=SCHEMA_DUMP_HAP_CONFIG, @@ -201,7 +201,7 @@ async def async_call_hmipc_service(service: ServiceCall) -> None: async_register_admin_service( hass=hass, - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_RESET_ENERGY_COUNTER, service_func=async_call_hmipc_service, schema=SCHEMA_RESET_ENERGY_COUNTER, @@ -209,7 +209,7 @@ async def async_call_hmipc_service(service: ServiceCall) -> None: async_register_admin_service( hass=hass, - domain=HMIPC_DOMAIN, + domain=DOMAIN, service=SERVICE_SET_HOME_COOLING_MODE, service_func=async_call_hmipc_service, schema=SCHEMA_SET_HOME_COOLING_MODE, @@ -218,11 +218,11 @@ async def async_call_hmipc_service(service: ServiceCall) -> None: async def async_unload_services(hass: HomeAssistant): """Unload HomematicIP Cloud services.""" - if hass.data[HMIPC_DOMAIN]: + if hass.data[DOMAIN]: return for hmipc_service in HMIPC_SERVICES: - hass.services.async_remove(domain=HMIPC_DOMAIN, service=hmipc_service) + hass.services.async_remove(domain=DOMAIN, service=hmipc_service) async def _async_activate_eco_mode_with_duration( @@ -235,7 +235,7 @@ async def _async_activate_eco_mode_with_duration( if home := _get_home(hass, hapid): await home.activate_absence_with_duration(duration) else: - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): await hap.home.activate_absence_with_duration(duration) @@ -249,7 +249,7 @@ async def _async_activate_eco_mode_with_period( if home := _get_home(hass, hapid): await home.activate_absence_with_period(endtime) else: - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): await hap.home.activate_absence_with_period(endtime) @@ -262,7 +262,7 @@ async def _async_activate_vacation(hass: HomeAssistant, service: ServiceCall) -> if home := _get_home(hass, hapid): await home.activate_vacation(endtime, temperature) else: - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): await hap.home.activate_vacation(endtime, temperature) @@ -272,7 +272,7 @@ async def _async_deactivate_eco_mode(hass: HomeAssistant, service: ServiceCall) if home := _get_home(hass, hapid): await home.deactivate_absence() else: - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): await hap.home.deactivate_absence() @@ -282,7 +282,7 @@ async def _async_deactivate_vacation(hass: HomeAssistant, service: ServiceCall) if home := _get_home(hass, hapid): await home.deactivate_vacation() else: - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): await hap.home.deactivate_vacation() @@ -293,7 +293,7 @@ async def _set_active_climate_profile( entity_id_list = service.data[ATTR_ENTITY_ID] climate_profile_index = service.data[ATTR_CLIMATE_PROFILE_INDEX] - 1 - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): if entity_id_list != "all": for entity_id in entity_id_list: group = hap.hmip_device_by_entity_id.get(entity_id) @@ -313,7 +313,7 @@ async def _async_dump_hap_config(hass: HomeAssistant, service: ServiceCall) -> N config_file_prefix = service.data[ATTR_CONFIG_OUTPUT_FILE_PREFIX] anonymize = service.data[ATTR_ANONYMIZE] - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): hap_sgtin = hap.config_entry.unique_id if anonymize: @@ -333,7 +333,7 @@ async def _async_reset_energy_counter(hass: HomeAssistant, service: ServiceCall) """Service to reset the energy counter.""" entity_id_list = service.data[ATTR_ENTITY_ID] - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): if entity_id_list != "all": for entity_id in entity_id_list: device = hap.hmip_device_by_entity_id.get(entity_id) @@ -353,17 +353,17 @@ async def _async_set_home_cooling_mode(hass: HomeAssistant, service: ServiceCall if home := _get_home(hass, hapid): await home.set_cooling(cooling) else: - for hap in hass.data[HMIPC_DOMAIN].values(): + for hap in hass.data[DOMAIN].values(): await hap.home.set_cooling(cooling) def _get_home(hass: HomeAssistant, hapid: str) -> AsyncHome | None: """Return a HmIP home.""" - if hap := hass.data[HMIPC_DOMAIN].get(hapid): + if hap := hass.data[DOMAIN].get(hapid): return hap.home raise ServiceValidationError( - translation_domain=HMIPC_DOMAIN, + translation_domain=DOMAIN, translation_key="access_point_not_found", translation_placeholders={"id": hapid}, ) diff --git a/homeassistant/components/homematicip_cloud/switch.py b/homeassistant/components/homematicip_cloud/switch.py index 9aa60d45d93b8e..70bf14631cb408 100644 --- a/homeassistant/components/homematicip_cloud/switch.py +++ b/homeassistant/components/homematicip_cloud/switch.py @@ -27,8 +27,8 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity -from .generic_entity import ATTR_GROUP_MEMBER_UNREACHABLE +from .const import DOMAIN +from .entity import ATTR_GROUP_MEMBER_UNREACHABLE, HomematicipGenericEntity from .hap import HomematicipHAP @@ -38,7 +38,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP switch from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] entities: list[HomematicipGenericEntity] = [ HomematicipGroupSwitch(hap, group) for group in hap.home.groups diff --git a/homeassistant/components/homematicip_cloud/weather.py b/homeassistant/components/homematicip_cloud/weather.py index 34e3f58d6ef960..cbe7c2845b83d7 100644 --- a/homeassistant/components/homematicip_cloud/weather.py +++ b/homeassistant/components/homematicip_cloud/weather.py @@ -27,7 +27,8 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as HMIPC_DOMAIN, HomematicipGenericEntity +from .const import DOMAIN +from .entity import HomematicipGenericEntity from .hap import HomematicipHAP HOME_WEATHER_CONDITION = { @@ -55,7 +56,7 @@ async def async_setup_entry( async_add_entities: AddEntitiesCallback, ) -> None: """Set up the HomematicIP weather sensor from a config entry.""" - hap = hass.data[HMIPC_DOMAIN][config_entry.unique_id] + hap = hass.data[DOMAIN][config_entry.unique_id] entities: list[HomematicipGenericEntity] = [] for device in hap.home.devices: if isinstance(device, AsyncWeatherSensorPro): diff --git a/tests/components/homematicip_cloud/helper.py b/tests/components/homematicip_cloud/helper.py index 229b3c20251864..d42b9602d38482 100644 --- a/tests/components/homematicip_cloud/helper.py +++ b/tests/components/homematicip_cloud/helper.py @@ -16,7 +16,7 @@ from homematicip.home import Home from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN -from homeassistant.components.homematicip_cloud.generic_entity import ( +from homeassistant.components.homematicip_cloud.entity import ( ATTR_IS_GROUP, ATTR_MODEL_TYPE, ) diff --git a/tests/components/homematicip_cloud/test_binary_sensor.py b/tests/components/homematicip_cloud/test_binary_sensor.py index d6ea33ed5fbfa6..02e96b10fe8822 100644 --- a/tests/components/homematicip_cloud/test_binary_sensor.py +++ b/tests/components/homematicip_cloud/test_binary_sensor.py @@ -16,7 +16,7 @@ ATTR_WATER_LEVEL_DETECTED, ATTR_WINDOW_STATE, ) -from homeassistant.components.homematicip_cloud.generic_entity import ( +from homeassistant.components.homematicip_cloud.entity import ( ATTR_EVENT_DELAY, ATTR_GROUP_MEMBER_UNREACHABLE, ATTR_LOW_BATTERY, diff --git a/tests/components/homematicip_cloud/test_sensor.py b/tests/components/homematicip_cloud/test_sensor.py index 4028f6d189eba9..07cf5ea0ae5b7c 100644 --- a/tests/components/homematicip_cloud/test_sensor.py +++ b/tests/components/homematicip_cloud/test_sensor.py @@ -3,7 +3,7 @@ from homematicip.base.enums import ValveState from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN -from homeassistant.components.homematicip_cloud.generic_entity import ( +from homeassistant.components.homematicip_cloud.entity import ( ATTR_CONFIG_PENDING, ATTR_DEVICE_OVERHEATED, ATTR_DEVICE_OVERLOADED, diff --git a/tests/components/homematicip_cloud/test_switch.py b/tests/components/homematicip_cloud/test_switch.py index e4b51688ba789f..54cdd632d03977 100644 --- a/tests/components/homematicip_cloud/test_switch.py +++ b/tests/components/homematicip_cloud/test_switch.py @@ -1,7 +1,7 @@ """Tests for HomematicIP Cloud switch.""" from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN -from homeassistant.components.homematicip_cloud.generic_entity import ( +from homeassistant.components.homematicip_cloud.entity import ( ATTR_GROUP_MEMBER_UNREACHABLE, ) from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN