Fix cover, light, select, sensor, switch type hints in zha (#73770)

* Fix zha sensor type hints

* Fix zha entity type hints

* Fix switch type hints

* Fix light type hints

* Fix cover type hints

* Fix select type hints
This commit is contained in:
epenet 2022-06-22 03:04:24 +02:00 committed by GitHub
parent 6c83ed4c9d
commit 243905ae3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 45 deletions

View file

@ -128,9 +128,9 @@ class BaseZhaEntity(LogMixin, entity.Entity):
@callback
def async_accept_signal(
self,
channel: ZigbeeChannel,
channel: ZigbeeChannel | None,
signal: str,
func: Callable[[], Any],
func: Callable[..., Any],
signal_override=False,
):
"""Accept a signal from a channel."""
@ -138,6 +138,7 @@ class BaseZhaEntity(LogMixin, entity.Entity):
if signal_override:
unsub = async_dispatcher_connect(self.hass, signal, func)
else:
assert channel
unsub = async_dispatcher_connect(
self.hass, f"{channel.unique_id}_{signal}", func
)
@ -305,7 +306,7 @@ class ZhaGroupEntity(BaseZhaEntity):
if self._change_listener_debouncer is None:
self._change_listener_debouncer = Debouncer(
self.hass,
self,
_LOGGER,
cooldown=UPDATE_GROUP_FROM_CHILD_DELAY,
immediate=False,
function=functools.partial(self.async_update_ha_state, True),
@ -325,6 +326,7 @@ class ZhaGroupEntity(BaseZhaEntity):
def async_state_changed_listener(self, event: Event):
"""Handle child updates."""
# Delay to ensure that we get updates from all members before updating the group
assert self._change_listener_debouncer
self.hass.create_task(self._change_listener_debouncer.async_call())
async def async_will_remove_from_hass(self) -> None: