1 """Support for AVM FRITZ!Box update platform."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
11 UpdateEntityDescription,
19 from .const
import DOMAIN
20 from .coordinator
import AvmWrapper
21 from .entity
import FritzBoxBaseCoordinatorEntity, FritzEntityDescription
23 _LOGGER = logging.getLogger(__name__)
26 @dataclass(frozen=True, kw_only=True)
28 """Describes Fritz update entity."""
32 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
34 """Set up AVM FRITZ!Box update entities."""
35 _LOGGER.debug(
"Setting up AVM FRITZ!Box update entities")
36 avm_wrapper: AvmWrapper = hass.data[DOMAIN][entry.entry_id]
38 entities = [FritzBoxUpdateEntity(avm_wrapper, entry.title)]
44 """Mixin for update entity specific attributes."""
46 _attr_entity_category = EntityCategory.CONFIG
47 _attr_supported_features = UpdateEntityFeature.INSTALL
48 _attr_title =
"FRITZ!OS"
49 entity_description: FritzUpdateEntityDescription
53 avm_wrapper: AvmWrapper,
54 device_friendly_name: str,
56 """Init FRITZ!Box connectivity class."""
58 key=
"update", name=
"FRITZ!OS", value_fn=
None
60 super().
__init__(avm_wrapper, device_friendly_name, description)
64 """Version currently in use."""
65 return self.coordinator.current_firmware
69 """Latest version available for install."""
70 if self.coordinator.update_available:
71 return self.coordinator.latest_firmware
72 return self.coordinator.current_firmware
76 """URL to the full release notes of the latest version available."""
77 return self.coordinator.release_url
80 self, version: str |
None, backup: bool, **kwargs: Any
82 """Install an update."""
str|None release_url(self)
None async_install(self, str|None version, bool backup, **Any kwargs)
str|None latest_version(self)
None __init__(self, AvmWrapper avm_wrapper, str device_friendly_name)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)