diff --git a/homeassistant/components/zha/update.py b/homeassistant/components/zha/update.py index 93912fc68db..e92424acf47 100644 --- a/homeassistant/components/zha/update.py +++ b/homeassistant/components/zha/update.py @@ -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 diff --git a/tests/components/zha/test_update.py b/tests/components/zha/test_update.py index c1424ca1730..981b8ba5e1b 100644 --- a/tests/components/zha/test_update.py +++ b/tests/components/zha/test_update.py @@ -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)