mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Fix dangling task for zha (#88302)
This commit is contained in:
parent
a5170340a3
commit
093f7d6bf1
@ -5,7 +5,6 @@ https://home-assistant.io/integrations/zha/
|
|||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
@ -351,7 +350,7 @@ class IASZoneChannel(ZigbeeChannel):
|
|||||||
elif command_id == 1:
|
elif command_id == 1:
|
||||||
self.debug("Enroll requested")
|
self.debug("Enroll requested")
|
||||||
res = self._cluster.enroll_response(0, 0)
|
res = self._cluster.enroll_response(0, 0)
|
||||||
asyncio.create_task(res)
|
self._cluster.create_catching_task(res)
|
||||||
|
|
||||||
async def async_configure(self):
|
async def async_configure(self):
|
||||||
"""Configure IAS device."""
|
"""Configure IAS device."""
|
||||||
|
@ -254,7 +254,9 @@ class ZHAGateway:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# background the fetching of state for mains powered devices
|
# background the fetching of state for mains powered devices
|
||||||
asyncio.create_task(fetch_updated_state())
|
self._hass.async_create_background_task(
|
||||||
|
fetch_updated_state(), "zha.gateway-fetch_updated_state"
|
||||||
|
)
|
||||||
|
|
||||||
def device_joined(self, device: zigpy.device.Device) -> None:
|
def device_joined(self, device: zigpy.device.Device) -> None:
|
||||||
"""Handle device joined.
|
"""Handle device joined.
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""Lights on Zigbee Home Automation networks."""
|
"""Lights on Zigbee Home Automation networks."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
@ -613,7 +612,10 @@ class BaseLight(LogMixin, light.LightEntity):
|
|||||||
)
|
)
|
||||||
if self._debounced_member_refresh is not None:
|
if self._debounced_member_refresh is not None:
|
||||||
self.debug("transition complete - refreshing group member states")
|
self.debug("transition complete - refreshing group member states")
|
||||||
asyncio.create_task(self._debounced_member_refresh.async_call())
|
self.hass.async_create_background_task(
|
||||||
|
self._debounced_member_refresh.async_call(),
|
||||||
|
"zha.light-refresh-debounced-member",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@STRICT_MATCH(channel_names=CHANNEL_ON_OFF, aux_channels={CHANNEL_COLOR, CHANNEL_LEVEL})
|
@STRICT_MATCH(channel_names=CHANNEL_ON_OFF, aux_channels={CHANNEL_COLOR, CHANNEL_LEVEL})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user