From 4d140d81f9f7451b9380260bf08939c3068dddfb Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:37:56 +0200 Subject: [PATCH] Move mysensors base entity to separate module (#126105) --- homeassistant/components/mysensors/__init__.py | 2 +- homeassistant/components/mysensors/binary_sensor.py | 2 +- homeassistant/components/mysensors/climate.py | 2 +- homeassistant/components/mysensors/cover.py | 2 +- homeassistant/components/mysensors/device_tracker.py | 2 +- homeassistant/components/mysensors/{device.py => entity.py} | 0 homeassistant/components/mysensors/handler.py | 2 +- homeassistant/components/mysensors/light.py | 2 +- homeassistant/components/mysensors/remote.py | 2 +- homeassistant/components/mysensors/sensor.py | 2 +- homeassistant/components/mysensors/switch.py | 2 +- homeassistant/components/mysensors/text.py | 2 +- tests/components/mysensors/conftest.py | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename homeassistant/components/mysensors/{device.py => entity.py} (100%) diff --git a/homeassistant/components/mysensors/__init__.py b/homeassistant/components/mysensors/__init__.py index 8ebcbe0e2fe..ce01f139dab 100644 --- a/homeassistant/components/mysensors/__init__.py +++ b/homeassistant/components/mysensors/__init__.py @@ -23,7 +23,7 @@ from .const import ( DiscoveryInfo, SensorType, ) -from .device import MySensorsChildEntity, get_mysensors_devices +from .entity import MySensorsChildEntity, get_mysensors_devices from .gateway import finish_setup, gw_stop, setup_gateway _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/mysensors/binary_sensor.py b/homeassistant/components/mysensors/binary_sensor.py index 47805e86b1c..54f7036b79c 100644 --- a/homeassistant/components/mysensors/binary_sensor.py +++ b/homeassistant/components/mysensors/binary_sensor.py @@ -19,7 +19,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/homeassistant/components/mysensors/climate.py b/homeassistant/components/mysensors/climate.py index 79bc7b4b98d..ce15faa589c 100644 --- a/homeassistant/components/mysensors/climate.py +++ b/homeassistant/components/mysensors/climate.py @@ -20,7 +20,7 @@ from homeassistant.util.unit_system import METRIC_SYSTEM from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload DICT_HA_TO_MYS = { diff --git a/homeassistant/components/mysensors/cover.py b/homeassistant/components/mysensors/cover.py index a5f4e7b1022..808589b9022 100644 --- a/homeassistant/components/mysensors/cover.py +++ b/homeassistant/components/mysensors/cover.py @@ -14,7 +14,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/homeassistant/components/mysensors/device_tracker.py b/homeassistant/components/mysensors/device_tracker.py index 968ee94b60e..af684ea195d 100644 --- a/homeassistant/components/mysensors/device_tracker.py +++ b/homeassistant/components/mysensors/device_tracker.py @@ -11,7 +11,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/homeassistant/components/mysensors/device.py b/homeassistant/components/mysensors/entity.py similarity index 100% rename from homeassistant/components/mysensors/device.py rename to homeassistant/components/mysensors/entity.py diff --git a/homeassistant/components/mysensors/handler.py b/homeassistant/components/mysensors/handler.py index 20e0ddd0e5a..96ea5347102 100644 --- a/homeassistant/components/mysensors/handler.py +++ b/homeassistant/components/mysensors/handler.py @@ -13,7 +13,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.util import decorator from .const import CHILD_CALLBACK, NODE_CALLBACK, DevId, GatewayId -from .device import get_mysensors_devices +from .entity import get_mysensors_devices from .helpers import ( discover_mysensors_node, discover_mysensors_platform, diff --git a/homeassistant/components/mysensors/light.py b/homeassistant/components/mysensors/light.py index e10aee6187f..a76b42359c1 100644 --- a/homeassistant/components/mysensors/light.py +++ b/homeassistant/components/mysensors/light.py @@ -20,7 +20,7 @@ from homeassistant.util.color import rgb_hex_to_rgb_list from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo, SensorType -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/homeassistant/components/mysensors/remote.py b/homeassistant/components/mysensors/remote.py index e9404bb3197..1a4f6fdaa90 100644 --- a/homeassistant/components/mysensors/remote.py +++ b/homeassistant/components/mysensors/remote.py @@ -18,7 +18,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/homeassistant/components/mysensors/sensor.py b/homeassistant/components/mysensors/sensor.py index 695382c491b..3cf4be21757 100644 --- a/homeassistant/components/mysensors/sensor.py +++ b/homeassistant/components/mysensors/sensor.py @@ -49,7 +49,7 @@ from .const import ( DiscoveryInfo, NodeDiscoveryInfo, ) -from .device import MySensorNodeEntity, MySensorsChildEntity +from .entity import MySensorNodeEntity, MySensorsChildEntity from .helpers import on_unload SENSORS: dict[str, SensorEntityDescription] = { diff --git a/homeassistant/components/mysensors/switch.py b/homeassistant/components/mysensors/switch.py index 400ef2c5896..4eabf6374f1 100644 --- a/homeassistant/components/mysensors/switch.py +++ b/homeassistant/components/mysensors/switch.py @@ -13,7 +13,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo, SensorType -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/homeassistant/components/mysensors/text.py b/homeassistant/components/mysensors/text.py index 8aed9df2eef..4edb5ccdbd8 100644 --- a/homeassistant/components/mysensors/text.py +++ b/homeassistant/components/mysensors/text.py @@ -11,7 +11,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import setup_mysensors_platform from .const import MYSENSORS_DISCOVERY, DiscoveryInfo -from .device import MySensorsChildEntity +from .entity import MySensorsChildEntity from .helpers import on_unload diff --git a/tests/components/mysensors/conftest.py b/tests/components/mysensors/conftest.py index b6fce35a4c7..1d407815db0 100644 --- a/tests/components/mysensors/conftest.py +++ b/tests/components/mysensors/conftest.py @@ -141,7 +141,7 @@ async def integration_fixture( config: dict[str, Any] = {} config_entry.add_to_hass(hass) with patch( - "homeassistant.components.mysensors.device.Debouncer", autospec=True + "homeassistant.components.mysensors.entity.Debouncer", autospec=True ) as debouncer_class: def debouncer(