From 55c723753e28672c1b2c92856362771099b9e31f Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 19 Apr 2023 17:13:58 +0200 Subject: [PATCH] Cleanup device handles on ZHA controller shutdown (#91591) --- homeassistant/components/zha/core/gateway.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/zha/core/gateway.py b/homeassistant/components/zha/core/gateway.py index 4b9089e4690..02c16930d53 100644 --- a/homeassistant/components/zha/core/gateway.py +++ b/homeassistant/components/zha/core/gateway.py @@ -733,6 +733,8 @@ class ZHAGateway: _LOGGER.debug("Shutting down ZHA ControllerApplication") for unsubscribe in self._unsubs: unsubscribe() + for device in self.devices.values(): + device.async_cleanup_handles() await self.application_controller.shutdown() def handle_message(