Add back missing controller cleanup to Govee Light Local (#151541)

This commit is contained in:
Abílio Costa
2025-09-02 08:42:08 +00:00
committed by Franck Nijhof
parent 1039936f39
commit ac4eef0571
@@ -52,14 +52,9 @@ async def _async_discover(hass: HomeAssistant, adapter_ip: IPv4Address) -> bool:
_LOGGER.debug("No devices found with IP %s", adapter_ip)
devices_count = len(controller.devices)
cleanup_complete_events: list[asyncio.Event] = []
cleanup_complete: asyncio.Event = controller.cleanup()
with suppress(TimeoutError):
await asyncio.gather(
*[
asyncio.wait_for(cleanup_complete_event.wait(), 1)
for cleanup_complete_event in cleanup_complete_events
]
)
await asyncio.wait_for(cleanup_complete.wait(), 1)
return devices_count > 0