Update xknx to 0.18.7 (#52000)

This commit is contained in:
Matthias Alphart 2021-06-19 05:22:27 +02:00 committed by GitHub
parent 8901e1f157
commit c246e211eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 10 deletions

View File

@ -324,3 +324,15 @@ class KNXClimate(KnxEntity, ClimateEntity):
knx_operation_mode = HVACOperationMode(PRESET_MODES_INV.get(preset_mode)) knx_operation_mode = HVACOperationMode(PRESET_MODES_INV.get(preset_mode))
await self._device.mode.set_operation_mode(knx_operation_mode) await self._device.mode.set_operation_mode(knx_operation_mode)
self.async_write_ha_state() self.async_write_ha_state()
async def async_added_to_hass(self) -> None:
"""Store register state change callback."""
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."""
super().async_will_remove_from_hass()
if self._device.mode is not None:
self._device.mode.unregister_device_updated_cb(self.after_update_callback)

View File

@ -3,7 +3,7 @@ from __future__ import annotations
from typing import cast from typing import cast
from xknx.devices import Climate as XknxClimate, Device as XknxDevice from xknx.devices import Device as XknxDevice
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
@ -52,12 +52,6 @@ class KnxEntity(Entity):
"""Store register state change callback.""" """Store register state change callback."""
self._device.register_device_updated_cb(self.after_update_callback) self._device.register_device_updated_cb(self.after_update_callback)
if isinstance(self._device, XknxClimate) and 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: async def async_will_remove_from_hass(self) -> None:
"""Disconnect device object when removed.""" """Disconnect device object when removed."""
self._device.unregister_device_updated_cb(self.after_update_callback) self._device.unregister_device_updated_cb(self.after_update_callback)
if isinstance(self._device, XknxClimate) and self._device.mode is not None:
self._device.mode.unregister_device_updated_cb(self.after_update_callback)

View File

@ -2,7 +2,7 @@
"domain": "knx", "domain": "knx",
"name": "KNX", "name": "KNX",
"documentation": "https://www.home-assistant.io/integrations/knx", "documentation": "https://www.home-assistant.io/integrations/knx",
"requirements": ["xknx==0.18.6"], "requirements": ["xknx==0.18.7"],
"codeowners": ["@Julius2342", "@farmio", "@marvin-w"], "codeowners": ["@Julius2342", "@farmio", "@marvin-w"],
"quality_scale": "silver", "quality_scale": "silver",
"iot_class": "local_push" "iot_class": "local_push"

View File

@ -2380,7 +2380,7 @@ xbox-webapi==2.0.11
xboxapi==2.0.1 xboxapi==2.0.1
# homeassistant.components.knx # homeassistant.components.knx
xknx==0.18.6 xknx==0.18.7
# homeassistant.components.bluesound # homeassistant.components.bluesound
# homeassistant.components.rest # homeassistant.components.rest

View File

@ -1292,7 +1292,7 @@ wolf_smartset==0.1.11
xbox-webapi==2.0.11 xbox-webapi==2.0.11
# homeassistant.components.knx # homeassistant.components.knx
xknx==0.18.6 xknx==0.18.7
# homeassistant.components.bluesound # homeassistant.components.bluesound
# homeassistant.components.rest # homeassistant.components.rest