mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Move and rename ihc base entity to separate module (#126101)
This commit is contained in:
parent
3a55cbc818
commit
ecea251efa
@ -15,7 +15,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .const import CONF_INVERTING, DOMAIN, IHC_CONTROLLER
|
from .const import CONF_INVERTING, DOMAIN, IHC_CONTROLLER
|
||||||
from .ihcdevice import IHCDevice
|
from .entity import IHCEntity
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(
|
def setup_platform(
|
||||||
@ -48,7 +48,7 @@ def setup_platform(
|
|||||||
add_entities(devices)
|
add_entities(devices)
|
||||||
|
|
||||||
|
|
||||||
class IHCBinarySensor(IHCDevice, BinarySensorEntity):
|
class IHCBinarySensor(IHCEntity, BinarySensorEntity):
|
||||||
"""IHC Binary Sensor.
|
"""IHC Binary Sensor.
|
||||||
|
|
||||||
The associated IHC resource can be any in or output from a IHC product
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class IHCDevice(Entity):
|
class IHCEntity(Entity):
|
||||||
"""Base class for all IHC devices.
|
"""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.
|
registration of the IHC controller callback when the IHC resource changes.
|
||||||
Derived classes must implement the on_ihc_change method
|
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 homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
from .const import CONF_DIMMABLE, CONF_OFF_ID, CONF_ON_ID, DOMAIN, IHC_CONTROLLER
|
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
|
from .util import async_pulse, async_set_bool, async_set_int
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ def setup_platform(
|
|||||||
add_entities(devices)
|
add_entities(devices)
|
||||||
|
|
||||||
|
|
||||||
class IhcLight(IHCDevice, LightEntity):
|
class IhcLight(IHCEntity, LightEntity):
|
||||||
"""Representation of a IHC light.
|
"""Representation of a IHC light.
|
||||||
|
|
||||||
For dimmable lights, the associated IHC resource should be a 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 homeassistant.util.unit_system import TEMPERATURE_UNITS
|
||||||
|
|
||||||
from .const import DOMAIN, IHC_CONTROLLER
|
from .const import DOMAIN, IHC_CONTROLLER
|
||||||
from .ihcdevice import IHCDevice
|
from .entity import IHCEntity
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(
|
def setup_platform(
|
||||||
@ -38,7 +38,7 @@ def setup_platform(
|
|||||||
add_entities(devices)
|
add_entities(devices)
|
||||||
|
|
||||||
|
|
||||||
class IHCSensor(IHCDevice, SensorEntity):
|
class IHCSensor(IHCEntity, SensorEntity):
|
||||||
"""Implementation of the IHC sensor."""
|
"""Implementation of the IHC sensor."""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@ -12,7 +12,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
from .const import CONF_OFF_ID, CONF_ON_ID, DOMAIN, IHC_CONTROLLER
|
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
|
from .util import async_pulse, async_set_bool
|
||||||
|
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ def setup_platform(
|
|||||||
add_entities(devices)
|
add_entities(devices)
|
||||||
|
|
||||||
|
|
||||||
class IHCSwitch(IHCDevice, SwitchEntity):
|
class IHCSwitch(IHCEntity, SwitchEntity):
|
||||||
"""Representation of an IHC switch."""
|
"""Representation of an IHC switch."""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user