mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Cleanup ZHAEntity class (#30131)
Remove `_domain` attribute since we're not using it anymore.
This commit is contained in:
parent
8e3dfbd5c9
commit
9c23c4adf2
@ -102,7 +102,6 @@ async def _async_setup_entities(
|
|||||||
class BinarySensor(ZhaEntity, BinarySensorDevice):
|
class BinarySensor(ZhaEntity, BinarySensorDevice):
|
||||||
"""ZHA BinarySensor."""
|
"""ZHA BinarySensor."""
|
||||||
|
|
||||||
_domain = DOMAIN
|
|
||||||
_device_class = None
|
_device_class = None
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
@ -30,8 +30,6 @@ RESTART_GRACE_PERIOD = 7200 # 2 hours
|
|||||||
class ZhaEntity(RestoreEntity, LogMixin, entity.Entity):
|
class ZhaEntity(RestoreEntity, LogMixin, entity.Entity):
|
||||||
"""A base class for ZHA entities."""
|
"""A base class for ZHA entities."""
|
||||||
|
|
||||||
_domain = None # Must be overridden by subclasses
|
|
||||||
|
|
||||||
def __init__(self, unique_id, zha_device, channels, skip_entity_id=False, **kwargs):
|
def __init__(self, unique_id, zha_device, channels, skip_entity_id=False, **kwargs):
|
||||||
"""Init ZHA entity."""
|
"""Init ZHA entity."""
|
||||||
self._force_update = False
|
self._force_update = False
|
||||||
|
@ -87,8 +87,6 @@ async def _async_setup_entities(
|
|||||||
class ZhaFan(ZhaEntity, FanEntity):
|
class ZhaFan(ZhaEntity, FanEntity):
|
||||||
"""Representation of a ZHA fan."""
|
"""Representation of a ZHA fan."""
|
||||||
|
|
||||||
_domain = DOMAIN
|
|
||||||
|
|
||||||
def __init__(self, unique_id, zha_device, channels, **kwargs):
|
def __init__(self, unique_id, zha_device, channels, **kwargs):
|
||||||
"""Init this sensor."""
|
"""Init this sensor."""
|
||||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||||
|
@ -80,8 +80,6 @@ async def _async_setup_entities(
|
|||||||
class Light(ZhaEntity, light.Light):
|
class Light(ZhaEntity, light.Light):
|
||||||
"""Representation of a ZHA or ZLL light."""
|
"""Representation of a ZHA or ZLL light."""
|
||||||
|
|
||||||
_domain = light.DOMAIN
|
|
||||||
|
|
||||||
def __init__(self, unique_id, zha_device, channels, **kwargs):
|
def __init__(self, unique_id, zha_device, channels, **kwargs):
|
||||||
"""Initialize the ZHA light."""
|
"""Initialize the ZHA light."""
|
||||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||||
|
@ -70,8 +70,6 @@ async def _async_setup_entities(
|
|||||||
class ZhaDoorLock(ZhaEntity, LockDevice):
|
class ZhaDoorLock(ZhaEntity, LockDevice):
|
||||||
"""Representation of a ZHA lock."""
|
"""Representation of a ZHA lock."""
|
||||||
|
|
||||||
_domain = DOMAIN
|
|
||||||
|
|
||||||
def __init__(self, unique_id, zha_device, channels, **kwargs):
|
def __init__(self, unique_id, zha_device, channels, **kwargs):
|
||||||
"""Init this sensor."""
|
"""Init this sensor."""
|
||||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||||
|
@ -109,7 +109,6 @@ class Sensor(ZhaEntity):
|
|||||||
_decimals = 1
|
_decimals = 1
|
||||||
_device_class = None
|
_device_class = None
|
||||||
_divisor = 1
|
_divisor = 1
|
||||||
_domain = DOMAIN
|
|
||||||
_multiplier = 1
|
_multiplier = 1
|
||||||
_unit = None
|
_unit = None
|
||||||
|
|
||||||
|
@ -60,8 +60,6 @@ async def _async_setup_entities(
|
|||||||
class Switch(ZhaEntity, SwitchDevice):
|
class Switch(ZhaEntity, SwitchDevice):
|
||||||
"""ZHA switch."""
|
"""ZHA switch."""
|
||||||
|
|
||||||
_domain = DOMAIN
|
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
"""Initialize the ZHA switch."""
|
"""Initialize the ZHA switch."""
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user