Skip to content

Commit 875d81c

Browse files
authored
update pyHomee to v1.2.9 (home-assistant#147094)
1 parent 956f726 commit 875d81c

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed

homeassistant/components/homee/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: HomeeConfigEntry) -> boo
6767
entry.runtime_data = homee
6868
entry.async_on_unload(homee.disconnect)
6969

70-
def _connection_update_callback(connected: bool) -> None:
70+
async def _connection_update_callback(connected: bool) -> None:
7171
"""Call when the device is notified of changes."""
7272
if connected:
7373
_LOGGER.warning("Reconnected to Homee at %s", entry.data[CONF_HOST])

homeassistant/components/homee/entity.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def __init__(self, attribute: HomeeAttribute, entry: HomeeConfigEntry) -> None:
2828
self._entry = entry
2929
node = entry.runtime_data.get_node_by_id(attribute.node_id)
3030
# Homee hub itself has node-id -1
31+
assert node is not None
3132
if node.id == -1:
3233
self._attr_device_info = DeviceInfo(
3334
identifiers={(DOMAIN, entry.runtime_data.settings.uid)},
@@ -79,7 +80,7 @@ async def async_update(self) -> None:
7980
def _on_node_updated(self, attribute: HomeeAttribute) -> None:
8081
self.schedule_update_ha_state()
8182

82-
def _on_connection_changed(self, connected: bool) -> None:
83+
async def _on_connection_changed(self, connected: bool) -> None:
8384
self._host_connected = connected
8485
self.schedule_update_ha_state()
8586

@@ -166,6 +167,6 @@ async def async_set_homee_value(
166167
def _on_node_updated(self, node: HomeeNode) -> None:
167168
self.schedule_update_ha_state()
168169

169-
def _on_connection_changed(self, connected: bool) -> None:
170+
async def _on_connection_changed(self, connected: bool) -> None:
170171
self._host_connected = connected
171172
self.schedule_update_ha_state()

homeassistant/components/homee/lock.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ def changed_by(self) -> str:
5858
AttributeChangedBy, self._attribute.changed_by
5959
)
6060
if self._attribute.changed_by == AttributeChangedBy.USER:
61-
changed_id = self._entry.runtime_data.get_user_by_id(
61+
user = self._entry.runtime_data.get_user_by_id(
6262
self._attribute.changed_by_id
63-
).username
63+
)
64+
if user is not None:
65+
changed_id = user.username
66+
else:
67+
changed_id = "Unknown"
6468

6569
return f"{changed_by_name}-{changed_id}"
6670

homeassistant/components/homee/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"iot_class": "local_push",
99
"loggers": ["homee"],
1010
"quality_scale": "bronze",
11-
"requirements": ["pyHomee==1.2.8"]
11+
"requirements": ["pyHomee==1.2.9"]
1212
}

homeassistant/components/homee/switch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def get_device_class(
2828
) -> SwitchDeviceClass:
2929
"""Check device class of Switch according to node profile."""
3030
node = config_entry.runtime_data.get_node_by_id(attribute.node_id)
31+
assert node is not None
3132
if node.profile in [
3233
NodeProfile.ON_OFF_PLUG,
3334
NodeProfile.METERING_PLUG,

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)