Skip to content

Commit

Permalink
Move and rename ihc base entity to separate module (home-assistant#12…
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Sep 17, 2024
1 parent 3a55cbc commit ecea251
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/ihc/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/ihc/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/ihc/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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__(
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/ihc/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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__(
Expand Down

0 comments on commit ecea251

Please sign in to comment.