From 1e2f7cadc7b5c508cc8dcfd548e6452c554bd89e Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 15 Aug 2025 15:27:49 +0200 Subject: [PATCH] Add unregister hook to Vera (#150708) --- homeassistant/components/vera/entity.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/vera/entity.py b/homeassistant/components/vera/entity.py index b3013c288c14..985761f2e63e 100644 --- a/homeassistant/components/vera/entity.py +++ b/homeassistant/components/vera/entity.py @@ -48,6 +48,10 @@ class VeraEntity[_DeviceTypeT: veraApi.VeraDevice](Entity): """Subscribe to updates.""" self.controller.register(self.vera_device, self._update_callback) + async def async_will_remove_from_hass(self) -> None: + """Unsubscribe from updates.""" + self.controller.unregister(self.vera_device, self._update_callback) + def _update_callback(self, _device: _DeviceTypeT) -> None: """Update the state.""" self.schedule_update_ha_state(True)