From 8a090befbc69c224762267778dd3658d4c90ec1a Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 27 Sep 2026 13:14:45 +0200 Subject: [PATCH] Disconnect zwave_me light signals on unload (#183278) Co-authored-by: Claude --- homeassistant/components/zwave_me/light.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/zwave_me/light.py b/homeassistant/components/zwave_me/light.py index fde70e45f912..c7ae9aa89944 100644 --- a/homeassistant/components/zwave_me/light.py +++ b/homeassistant/components/zwave_me/light.py @@ -33,14 +33,22 @@ async def async_setup_entry( """Add a new device.""" async_add_entities([ZWaveMeRGB(config_entry.runtime_data, new_device)]) - async_dispatcher_connect( - hass, f"ZWAVE_ME_NEW_{ZWaveMePlatform.RGB_LIGHT.upper()}", add_new_device + config_entry.async_on_unload( + async_dispatcher_connect( + hass, f"ZWAVE_ME_NEW_{ZWaveMePlatform.RGB_LIGHT.upper()}", add_new_device + ) ) - async_dispatcher_connect( - hass, f"ZWAVE_ME_NEW_{ZWaveMePlatform.RGBW_LIGHT.upper()}", add_new_device + config_entry.async_on_unload( + async_dispatcher_connect( + hass, f"ZWAVE_ME_NEW_{ZWaveMePlatform.RGBW_LIGHT.upper()}", add_new_device + ) ) - async_dispatcher_connect( - hass, f"ZWAVE_ME_NEW_{ZWaveMePlatform.BRIGHTNESS_LIGHT.upper()}", add_new_device + config_entry.async_on_unload( + async_dispatcher_connect( + hass, + f"ZWAVE_ME_NEW_{ZWaveMePlatform.BRIGHTNESS_LIGHT.upper()}", + add_new_device, + ) )