From 875d81cab2977bec2793a14f11028125dd84752e Mon Sep 17 00:00:00 2001 From: Markus Adrario Date: Thu, 19 Jun 2025 12:04:59 +0200 Subject: [PATCH] update pyHomee to v1.2.9 (#147094) --- homeassistant/components/homee/__init__.py | 2 +- homeassistant/components/homee/entity.py | 5 +++-- homeassistant/components/homee/lock.py | 8 ++++++-- homeassistant/components/homee/manifest.json | 2 +- homeassistant/components/homee/switch.py | 1 + requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/homee/__init__.py b/homeassistant/components/homee/__init__.py index e9eb1d86f02..0f90752733d 100644 --- a/homeassistant/components/homee/__init__.py +++ b/homeassistant/components/homee/__init__.py @@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: HomeeConfigEntry) -> boo entry.runtime_data = homee entry.async_on_unload(homee.disconnect) - def _connection_update_callback(connected: bool) -> None: + async def _connection_update_callback(connected: bool) -> None: """Call when the device is notified of changes.""" if connected: _LOGGER.warning("Reconnected to Homee at %s", entry.data[CONF_HOST]) diff --git a/homeassistant/components/homee/entity.py b/homeassistant/components/homee/entity.py index 4c85f52bb28..d8344c4226a 100644 --- a/homeassistant/components/homee/entity.py +++ b/homeassistant/components/homee/entity.py @@ -28,6 +28,7 @@ class HomeeEntity(Entity): self._entry = entry node = entry.runtime_data.get_node_by_id(attribute.node_id) # Homee hub itself has node-id -1 + assert node is not None if node.id == -1: self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, entry.runtime_data.settings.uid)}, @@ -79,7 +80,7 @@ class HomeeEntity(Entity): def _on_node_updated(self, attribute: HomeeAttribute) -> None: self.schedule_update_ha_state() - def _on_connection_changed(self, connected: bool) -> None: + async def _on_connection_changed(self, connected: bool) -> None: self._host_connected = connected self.schedule_update_ha_state() @@ -166,6 +167,6 @@ class HomeeNodeEntity(Entity): def _on_node_updated(self, node: HomeeNode) -> None: self.schedule_update_ha_state() - def _on_connection_changed(self, connected: bool) -> None: + async def _on_connection_changed(self, connected: bool) -> None: self._host_connected = connected self.schedule_update_ha_state() diff --git a/homeassistant/components/homee/lock.py b/homeassistant/components/homee/lock.py index 4cfc34e11fe..8b3bf58040d 100644 --- a/homeassistant/components/homee/lock.py +++ b/homeassistant/components/homee/lock.py @@ -58,9 +58,13 @@ class HomeeLock(HomeeEntity, LockEntity): AttributeChangedBy, self._attribute.changed_by ) if self._attribute.changed_by == AttributeChangedBy.USER: - changed_id = self._entry.runtime_data.get_user_by_id( + user = self._entry.runtime_data.get_user_by_id( self._attribute.changed_by_id - ).username + ) + if user is not None: + changed_id = user.username + else: + changed_id = "Unknown" return f"{changed_by_name}-{changed_id}" diff --git a/homeassistant/components/homee/manifest.json b/homeassistant/components/homee/manifest.json index 3c2a99c30dc..16ee6085439 100644 --- a/homeassistant/components/homee/manifest.json +++ b/homeassistant/components/homee/manifest.json @@ -8,5 +8,5 @@ "iot_class": "local_push", "loggers": ["homee"], "quality_scale": "bronze", - "requirements": ["pyHomee==1.2.8"] + "requirements": ["pyHomee==1.2.9"] } diff --git a/homeassistant/components/homee/switch.py b/homeassistant/components/homee/switch.py index 041b96963f1..5e87a1b4002 100644 --- a/homeassistant/components/homee/switch.py +++ b/homeassistant/components/homee/switch.py @@ -28,6 +28,7 @@ def get_device_class( ) -> SwitchDeviceClass: """Check device class of Switch according to node profile.""" node = config_entry.runtime_data.get_node_by_id(attribute.node_id) + assert node is not None if node.profile in [ NodeProfile.ON_OFF_PLUG, NodeProfile.METERING_PLUG, diff --git a/requirements_all.txt b/requirements_all.txt index 63d662c1139..fa23a9566fc 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1798,7 +1798,7 @@ pyEmby==1.10 pyHik==0.3.2 # homeassistant.components.homee -pyHomee==1.2.8 +pyHomee==1.2.9 # homeassistant.components.rfxtrx pyRFXtrx==0.31.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 13906014d2e..7188e1f1395 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1509,7 +1509,7 @@ pyDuotecno==2024.10.1 pyElectra==1.2.4 # homeassistant.components.homee -pyHomee==1.2.8 +pyHomee==1.2.9 # homeassistant.components.rfxtrx pyRFXtrx==0.31.1