1 """Update platform for IronOS integration."""
3 from __future__
import annotations
8 UpdateEntityDescription,
14 from .
import IRON_OS_KEY, IronOSConfigEntry, IronOSLiveDataCoordinator
15 from .coordinator
import IronOSFirmwareUpdateCoordinator
16 from .entity
import IronOSBaseEntity
20 device_class=UpdateDeviceClass.FIRMWARE,
26 entry: IronOSConfigEntry,
27 async_add_entities: AddEntitiesCallback,
29 """Set up IronOS update platform."""
31 coordinator = entry.runtime_data
34 [
IronOSUpdate(coordinator, hass.data[IRON_OS_KEY], UPDATE_DESCRIPTION)]
39 """Representation of an IronOS update entity."""
41 _attr_supported_features = UpdateEntityFeature.RELEASE_NOTES
45 coordinator: IronOSLiveDataCoordinator,
46 firmware_update: IronOSFirmwareUpdateCoordinator,
47 entity_description: UpdateEntityDescription,
49 """Initialize the sensor."""
51 super().
__init__(coordinator, entity_description)
55 """IronOS version on the device."""
57 return self.coordinator.device_info.build
61 """Title of the IronOS release."""
63 return f
"IronOS {self.firmware_update.data.name}"
67 """URL to the full release notes of the latest IronOS version available."""
73 """Latest IronOS version available for install."""
78 """Return the release notes."""
83 """When entity is added to hass.
85 Register extra update listener for the firmware update coordinator.
94 """Return if entity is available."""
str|None async_release_notes(self)
None async_added_to_hass(self)
str|None installed_version(self)
str|None release_url(self)
str|None latest_version(self)
None __init__(self, IronOSLiveDataCoordinator coordinator, IronOSFirmwareUpdateCoordinator firmware_update, UpdateEntityDescription entity_description)
str|None installed_version(self)
None async_on_remove(self, CALLBACK_TYPE func)
Callable[[], None] async_add_listener(self, CALLBACK_TYPE update_callback, Any context=None)
None async_setup_entry(HomeAssistant hass, IronOSConfigEntry entry, AddEntitiesCallback async_add_entities)