Move and rename ihc base entity to separate module (#126101)

pull/126128/head
epenet 2024-09-17 15:39:49 +02:00 committed by GitHub
parent 3a55cbc818
commit ecea251efa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
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

View File

@ -11,10 +11,10 @@ from .const import CONF_INFO, DOMAIN
_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
"""

View File

@ -12,7 +12,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
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

View File

@ -12,7 +12,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
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__(

View File

@ -12,7 +12,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
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__(