ZHA code cleanup. (#25644)
* isort ZHA imports. * Sort zha channel registry. * Sort ZHA core registry. * Sort ZHA core consts.
This commit is contained in:
1 parent
39257164a9
commit
77e4ff94fd
26 files changed
+627
-563
No files matched your search
@@ -2,16 +2,18 @@
|
||||
import logging
|
||||
|
||||
from zigpy.zcl.foundation import Status
|
||||
|
||||
from homeassistant.components.switch import DOMAIN, SwitchDevice
|
||||
from homeassistant.const import STATE_ON
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from .core.const import (
|
||||
DATA_ZHA,
|
||||
DATA_ZHA_DISPATCHERS,
|
||||
ZHA_DISCOVERY_NEW,
|
||||
ON_OFF_CHANNEL,
|
||||
CHANNEL_ON_OFF,
|
||||
SIGNAL_ATTR_UPDATED,
|
||||
ZHA_DISCOVERY_NEW,
|
||||
)
|
||||
from .entity import ZhaEntity
|
||||
|
||||
@@ -63,7 +65,7 @@ class Switch(ZhaEntity, SwitchDevice):
|
||||
def __init__(self, **kwargs):
|
||||
"""Initialize the ZHA switch."""
|
||||
super().__init__(**kwargs)
|
||||
self._on_off_channel = self.cluster_channels.get(ON_OFF_CHANNEL)
|
||||
self._on_off_channel = self.cluster_channels.get(CHANNEL_ON_OFF)
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
|
||||
Reference in new issue
Block a user