Bump ZHA to 0.0.64 (#149683)

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
Co-authored-by: abmantis <amfcalt@gmail.com>
This commit is contained in:
puddly 2025-07-30 13:59:41 -04:00 committed by GitHub
parent 8d27ca1e21
commit 389a1251a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 78 additions and 5 deletions

View File

@ -74,7 +74,12 @@ from zha.event import EventBase
from zha.exceptions import ZHAException
from zha.mixins import LogMixin
from zha.zigbee.cluster_handlers import ClusterBindEvent, ClusterConfigureReportingEvent
from zha.zigbee.device import ClusterHandlerConfigurationComplete, Device, ZHAEvent
from zha.zigbee.device import (
ClusterHandlerConfigurationComplete,
Device,
DeviceFirmwareInfoUpdatedEvent,
ZHAEvent,
)
from zha.zigbee.group import Group, GroupInfo, GroupMember
from zigpy.config import (
CONF_DATABASE,
@ -843,8 +848,23 @@ class ZHAGatewayProxy(EventBase):
name=zha_device.name,
manufacturer=zha_device.manufacturer,
model=zha_device.model,
sw_version=zha_device.firmware_version,
)
zha_device_proxy.device_id = device_registry_device.id
def update_sw_version(event: DeviceFirmwareInfoUpdatedEvent) -> None:
"""Update software version in device registry."""
device_registry.async_update_device(
device_registry_device.id,
sw_version=event.new_firmware_version,
)
self._unsubs.append(
zha_device.on_event(
DeviceFirmwareInfoUpdatedEvent.event_type, update_sw_version
)
)
return zha_device_proxy
def _async_get_or_create_group_proxy(self, group_info: GroupInfo) -> ZHAGroupProxy:

View File

@ -21,7 +21,7 @@
"zha",
"universal_silabs_flasher"
],
"requirements": ["zha==0.0.62"],
"requirements": ["zha==0.0.64"],
"usb": [
{
"vid": "10C4",

View File

@ -616,6 +616,18 @@
},
"water_supply": {
"name": "Water supply"
},
"frient_in_1": {
"name": "IN1"
},
"frient_in_2": {
"name": "IN2"
},
"frient_in_3": {
"name": "IN3"
},
"frient_in_4": {
"name": "IN4"
}
},
"button": {
@ -639,6 +651,9 @@
},
"frost_lock_reset": {
"name": "Frost lock reset"
},
"reset_alarm": {
"name": "Reset alarm"
}
},
"climate": {
@ -1472,6 +1487,9 @@
"tier6_summation_delivered": {
"name": "Tier 6 summation delivered"
},
"total_active_power": {
"name": "Total power"
},
"summation_received": {
"name": "Summation received"
},
@ -2006,6 +2024,18 @@
},
"auto_relock": {
"name": "Autorelock"
},
"distance_tracking": {
"name": "Distance tracking"
},
"water_shortage_auto_close": {
"name": "Water shortage auto-close"
},
"frient_com_1": {
"name": "COM 1"
},
"frient_com_2": {
"name": "COM 2"
}
}
}

2
requirements_all.txt generated
View File

@ -3203,7 +3203,7 @@ zeroconf==0.147.0
zeversolar==0.3.2
# homeassistant.components.zha
zha==0.0.62
zha==0.0.64
# homeassistant.components.zhong_hong
zhong-hong-hvac==1.0.13

View File

@ -2647,7 +2647,7 @@ zeroconf==0.147.0
zeversolar==0.3.2
# homeassistant.components.zha
zha==0.0.62
zha==0.0.64
# homeassistant.components.zwave_js
zwave-js-server-python==0.67.0

View File

@ -47,6 +47,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import device_registry as dr
from homeassistant.setup import async_setup_component
from .common import find_entity_id, update_attribute_cache
@ -156,7 +157,6 @@ async def setup_test_data(
)
)
zha_device_proxy: ZHADeviceProxy = gateway_proxy.get_device_proxy(zigpy_device.ieee)
zha_device_proxy.device.async_update_sw_build_id(installed_fw_version)
return zha_device_proxy, cluster, fw_image, installed_fw_version
@ -643,3 +643,26 @@ async def test_update_release_notes(
assert "Some lengthy release notes" in result["result"]
assert OTA_MESSAGE_RELIABILITY in result["result"]
assert OTA_MESSAGE_BATTERY_POWERED in result["result"]
async def test_update_version_sync_device_registry(
hass: HomeAssistant,
setup_zha,
zigpy_device_mock,
device_registry: dr.DeviceRegistry,
) -> None:
"""Test firmware version syncing between the ZHA device and Home Assistant."""
await setup_zha()
zha_device, _, _, _ = await setup_test_data(hass, zigpy_device_mock)
zha_device.device.async_update_firmware_version("0x12345678")
reg_device = device_registry.async_get_device(
identifiers={("zha", str(zha_device.device.ieee))}
)
assert reg_device.sw_version == "0x12345678"
zha_device.device.async_update_firmware_version("0xabcd1234")
reg_device = device_registry.async_get_device(
identifiers={("zha", str(zha_device.device.ieee))}
)
assert reg_device.sw_version == "0xabcd1234"