From ecea251efae15f04862f8ed89723df8b98429f00 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:39:49 +0200 Subject: [PATCH] Move and rename ihc base entity to separate module (#126101) --- homeassistant/components/ihc/binary_sensor.py | 4 ++-- homeassistant/components/ihc/{ihcdevice.py => entity.py} | 4 ++-- homeassistant/components/ihc/light.py | 4 ++-- homeassistant/components/ihc/sensor.py | 4 ++-- homeassistant/components/ihc/switch.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename homeassistant/components/ihc/{ihcdevice.py => entity.py} (97%) diff --git a/homeassistant/components/ihc/binary_sensor.py b/homeassistant/components/ihc/binary_sensor.py index ed273878cb454e..413d89ca027578 100644 --- a/homeassistant/components/ihc/binary_sensor.py +++ b/homeassistant/components/ihc/binary_sensor.py @@ -15,7 +15,7 @@ from homeassistant.util.enum import try_parse_enum from .const import CONF_INVERTING, DOMAIN, IHC_CONTROLLER -from .ihcdevice import IHCDevice +from .entity import IHCEntity def setup_platform( @@ -48,7 +48,7 @@ def setup_platform( add_entities(devices) -class IHCBinarySensor(IHCDevice, BinarySensorEntity): +class IHCBinarySensor(IHCEntity, BinarySensorEntity): """IHC Binary Sensor. The associated IHC resource can be any in or output from a IHC product diff --git a/homeassistant/components/ihc/ihcdevice.py b/homeassistant/components/ihc/entity.py similarity index 97% rename from homeassistant/components/ihc/ihcdevice.py rename to homeassistant/components/ihc/entity.py index 07ff71b812a4ab..f73c307986706f 100644 --- a/homeassistant/components/ihc/ihcdevice.py +++ b/homeassistant/components/ihc/entity.py @@ -11,10 +11,10 @@ _LOGGER = logging.getLogger(__name__) -class IHCDevice(Entity): +class IHCEntity(Entity): """Base class for all IHC devices. - All IHC devices have an associated IHC resource. IHCDevice handled the + All IHC devices have an associated IHC resource. IHCEntity handled the registration of the IHC controller callback when the IHC resource changes. Derived classes must implement the on_ihc_change method """ diff --git a/homeassistant/components/ihc/light.py b/homeassistant/components/ihc/light.py index 98e373daff493b..47f343304dcbbf 100644 --- a/homeassistant/components/ihc/light.py +++ b/homeassistant/components/ihc/light.py @@ -12,7 +12,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from .const import CONF_DIMMABLE, CONF_OFF_ID, CONF_ON_ID, DOMAIN, IHC_CONTROLLER -from .ihcdevice import IHCDevice +from .entity import IHCEntity from .util import async_pulse, async_set_bool, async_set_int @@ -50,7 +50,7 @@ def setup_platform( add_entities(devices) -class IhcLight(IHCDevice, LightEntity): +class IhcLight(IHCEntity, LightEntity): """Representation of a IHC light. For dimmable lights, the associated IHC resource should be a light diff --git a/homeassistant/components/ihc/sensor.py b/homeassistant/components/ihc/sensor.py index 1ca41ed2666d52..f3b722b2cdd52a 100644 --- a/homeassistant/components/ihc/sensor.py +++ b/homeassistant/components/ihc/sensor.py @@ -12,7 +12,7 @@ from homeassistant.util.unit_system import TEMPERATURE_UNITS from .const import DOMAIN, IHC_CONTROLLER -from .ihcdevice import IHCDevice +from .entity import IHCEntity def setup_platform( @@ -38,7 +38,7 @@ def setup_platform( add_entities(devices) -class IHCSensor(IHCDevice, SensorEntity): +class IHCSensor(IHCEntity, SensorEntity): """Implementation of the IHC sensor.""" def __init__( diff --git a/homeassistant/components/ihc/switch.py b/homeassistant/components/ihc/switch.py index f41f17bc998a09..b509c2dd10f1f7 100644 --- a/homeassistant/components/ihc/switch.py +++ b/homeassistant/components/ihc/switch.py @@ -12,7 +12,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from .const import CONF_OFF_ID, CONF_ON_ID, DOMAIN, IHC_CONTROLLER -from .ihcdevice import IHCDevice +from .entity import IHCEntity from .util import async_pulse, async_set_bool @@ -43,7 +43,7 @@ def setup_platform( add_entities(devices) -class IHCSwitch(IHCDevice, SwitchEntity): +class IHCSwitch(IHCEntity, SwitchEntity): """Representation of an IHC switch.""" def __init__(