Move and rename ihc base entity to separate module (#126101)
parent
3a55cbc818
commit
ecea251efa
|
@ -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
|
||||
|
|
|
@ -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
|
||||
"""
|
|
@ -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
|
||||
|
|
|
@ -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__(
|
||||
|
|
|
@ -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__(
|
||||
|
|
Loading…
Reference in New Issue