mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Fix ZHA update entity not updating installed version (#109260)
This commit is contained in:
parent
5c3bf13ca4
commit
c355dd77a4
@ -122,6 +122,7 @@ class ZHAFirmwareUpdateEntity(ZhaEntity, UpdateEntity):
|
||||
self._latest_version_firmware = image
|
||||
self._attr_latest_version = f"0x{image.header.file_version:08x}"
|
||||
self._image_type = image.header.image_type
|
||||
self._attr_installed_version = self.determine_installed_version()
|
||||
self.async_write_ha_state()
|
||||
|
||||
@callback
|
||||
|
@ -108,12 +108,18 @@ async def setup_test_data(
|
||||
return zha_device, cluster, fw_image, installed_fw_version
|
||||
|
||||
|
||||
@pytest.mark.parametrize("initial_version_unknown", (False, True))
|
||||
async def test_firmware_update_notification_from_zigpy(
|
||||
hass: HomeAssistant, zha_device_joined_restored, zigpy_device
|
||||
hass: HomeAssistant,
|
||||
zha_device_joined_restored,
|
||||
zigpy_device,
|
||||
initial_version_unknown,
|
||||
) -> None:
|
||||
"""Test ZHA update platform - firmware update notification."""
|
||||
zha_device, cluster, fw_image, installed_fw_version = await setup_test_data(
|
||||
zha_device_joined_restored, zigpy_device
|
||||
zha_device_joined_restored,
|
||||
zigpy_device,
|
||||
skip_attribute_plugs=initial_version_unknown,
|
||||
)
|
||||
|
||||
entity_id = find_entity_id(Platform.UPDATE, zha_device, hass)
|
||||
|
Loading…
x
Reference in New Issue
Block a user