diff --git a/homeassistant/components/knx/climate.py b/homeassistant/components/knx/climate.py index 63fbb170ca7..c9ec825bebc 100644 --- a/homeassistant/components/knx/climate.py +++ b/homeassistant/components/knx/climate.py @@ -296,9 +296,3 @@ class KNXClimate(KnxEntity, ClimateEntity): await super().async_added_to_hass() if self._device.mode is not None: self._device.mode.register_device_updated_cb(self.after_update_callback) - - async def async_will_remove_from_hass(self) -> None: - """Disconnect device object when removed.""" - await super().async_will_remove_from_hass() - if self._device.mode is not None: - self._device.mode.unregister_device_updated_cb(self.after_update_callback) diff --git a/homeassistant/components/knx/knx_entity.py b/homeassistant/components/knx/knx_entity.py index 5f2e14d1466..bd5ae199ccc 100644 --- a/homeassistant/components/knx/knx_entity.py +++ b/homeassistant/components/knx/knx_entity.py @@ -45,4 +45,5 @@ class KnxEntity(Entity): async def async_will_remove_from_hass(self) -> None: """Disconnect device object when removed.""" - self._device.unregister_device_updated_cb(self.after_update_callback) + # will also remove callbacks + self._device.shutdown() diff --git a/homeassistant/components/knx/manifest.json b/homeassistant/components/knx/manifest.json index 604821ae275..0fdabcec9fb 100644 --- a/homeassistant/components/knx/manifest.json +++ b/homeassistant/components/knx/manifest.json @@ -3,7 +3,7 @@ "name": "KNX", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/knx", - "requirements": ["xknx==0.20.1"], + "requirements": ["xknx==0.20.2"], "codeowners": ["@Julius2342", "@farmio", "@marvin-w"], "quality_scale": "silver", "iot_class": "local_push", diff --git a/requirements_all.txt b/requirements_all.txt index 44ede223ea9..2a658b280f9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2435,7 +2435,7 @@ xbox-webapi==2.0.11 xboxapi==2.0.1 # homeassistant.components.knx -xknx==0.20.1 +xknx==0.20.2 # homeassistant.components.bluesound # homeassistant.components.fritz diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 9e2f826ae1e..7650bccd4ee 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1575,7 +1575,7 @@ wolf_smartset==0.1.11 xbox-webapi==2.0.11 # homeassistant.components.knx -xknx==0.20.1 +xknx==0.20.2 # homeassistant.components.bluesound # homeassistant.components.fritz