mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
update pyHomee to v1.2.9 (#147094)
This commit is contained in:
parent
956f726ef3
commit
875d81cab2
@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: HomeeConfigEntry) -> boo
|
|||||||
entry.runtime_data = homee
|
entry.runtime_data = homee
|
||||||
entry.async_on_unload(homee.disconnect)
|
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."""
|
"""Call when the device is notified of changes."""
|
||||||
if connected:
|
if connected:
|
||||||
_LOGGER.warning("Reconnected to Homee at %s", entry.data[CONF_HOST])
|
_LOGGER.warning("Reconnected to Homee at %s", entry.data[CONF_HOST])
|
||||||
|
@ -28,6 +28,7 @@ class HomeeEntity(Entity):
|
|||||||
self._entry = entry
|
self._entry = entry
|
||||||
node = entry.runtime_data.get_node_by_id(attribute.node_id)
|
node = entry.runtime_data.get_node_by_id(attribute.node_id)
|
||||||
# Homee hub itself has node-id -1
|
# Homee hub itself has node-id -1
|
||||||
|
assert node is not None
|
||||||
if node.id == -1:
|
if node.id == -1:
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, entry.runtime_data.settings.uid)},
|
identifiers={(DOMAIN, entry.runtime_data.settings.uid)},
|
||||||
@ -79,7 +80,7 @@ class HomeeEntity(Entity):
|
|||||||
def _on_node_updated(self, attribute: HomeeAttribute) -> None:
|
def _on_node_updated(self, attribute: HomeeAttribute) -> None:
|
||||||
self.schedule_update_ha_state()
|
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._host_connected = connected
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
@ -166,6 +167,6 @@ class HomeeNodeEntity(Entity):
|
|||||||
def _on_node_updated(self, node: HomeeNode) -> None:
|
def _on_node_updated(self, node: HomeeNode) -> None:
|
||||||
self.schedule_update_ha_state()
|
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._host_connected = connected
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
@ -58,9 +58,13 @@ class HomeeLock(HomeeEntity, LockEntity):
|
|||||||
AttributeChangedBy, self._attribute.changed_by
|
AttributeChangedBy, self._attribute.changed_by
|
||||||
)
|
)
|
||||||
if self._attribute.changed_by == AttributeChangedBy.USER:
|
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
|
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}"
|
return f"{changed_by_name}-{changed_id}"
|
||||||
|
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"loggers": ["homee"],
|
"loggers": ["homee"],
|
||||||
"quality_scale": "bronze",
|
"quality_scale": "bronze",
|
||||||
"requirements": ["pyHomee==1.2.8"]
|
"requirements": ["pyHomee==1.2.9"]
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ def get_device_class(
|
|||||||
) -> SwitchDeviceClass:
|
) -> SwitchDeviceClass:
|
||||||
"""Check device class of Switch according to node profile."""
|
"""Check device class of Switch according to node profile."""
|
||||||
node = config_entry.runtime_data.get_node_by_id(attribute.node_id)
|
node = config_entry.runtime_data.get_node_by_id(attribute.node_id)
|
||||||
|
assert node is not None
|
||||||
if node.profile in [
|
if node.profile in [
|
||||||
NodeProfile.ON_OFF_PLUG,
|
NodeProfile.ON_OFF_PLUG,
|
||||||
NodeProfile.METERING_PLUG,
|
NodeProfile.METERING_PLUG,
|
||||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -1798,7 +1798,7 @@ pyEmby==1.10
|
|||||||
pyHik==0.3.2
|
pyHik==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.homee
|
# homeassistant.components.homee
|
||||||
pyHomee==1.2.8
|
pyHomee==1.2.9
|
||||||
|
|
||||||
# homeassistant.components.rfxtrx
|
# homeassistant.components.rfxtrx
|
||||||
pyRFXtrx==0.31.1
|
pyRFXtrx==0.31.1
|
||||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -1509,7 +1509,7 @@ pyDuotecno==2024.10.1
|
|||||||
pyElectra==1.2.4
|
pyElectra==1.2.4
|
||||||
|
|
||||||
# homeassistant.components.homee
|
# homeassistant.components.homee
|
||||||
pyHomee==1.2.8
|
pyHomee==1.2.9
|
||||||
|
|
||||||
# homeassistant.components.rfxtrx
|
# homeassistant.components.rfxtrx
|
||||||
pyRFXtrx==0.31.1
|
pyRFXtrx==0.31.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user