diff --git a/homeassistant/components/fritz/coordinator.py b/homeassistant/components/fritz/coordinator.py index 5915804aa138..005d85e9e1c9 100644 --- a/homeassistant/components/fritz/coordinator.py +++ b/homeassistant/components/fritz/coordinator.py @@ -938,3 +938,15 @@ class AvmWrapper(FritzBoxTools): "X_AVM-DE_WakeOnLANByMACAddress", NewMACAddress=mac_address, ) + + async def async_get_firmware_extra_infos(self) -> dict[str, Any]: + """Return extra infos for firmware.""" + return await self._async_service_call("UserInterface", "1", "X_AVM-DE_GetInfo") + + async def async_get_device_uptime_hours(self) -> int: + """Get device uptime in hours.""" + + def _get_uptime_hours() -> int: + return int(self.fritz_status.device_uptime // 3600) + + return await self.hass.async_add_executor_job(_get_uptime_hours) diff --git a/homeassistant/components/fritz/diagnostics.py b/homeassistant/components/fritz/diagnostics.py index 43ed80f6396d..0165e37de0c3 100644 --- a/homeassistant/components/fritz/diagnostics.py +++ b/homeassistant/components/fritz/diagnostics.py @@ -24,9 +24,11 @@ async def async_get_config_entry_diagnostics( "unique_id": avm_wrapper.unique_id.replace( avm_wrapper.unique_id[6:11], "XX:XX" ), + "device_uptime_hours": await avm_wrapper.async_get_device_uptime_hours(), "current_firmware": avm_wrapper.current_firmware, "latest_firmware": avm_wrapper.latest_firmware, "update_available": avm_wrapper.update_available, + "firmware_extra_infos": await avm_wrapper.async_get_firmware_extra_infos(), "connection_type": avm_wrapper.device_conn_type, "is_router": avm_wrapper.device_is_router, "mesh_role": avm_wrapper.mesh_role, diff --git a/tests/components/fritz/const.py b/tests/components/fritz/const.py index 4415f563ffd9..3e6d9741ca9c 100644 --- a/tests/components/fritz/const.py +++ b/tests/components/fritz/const.py @@ -97,6 +97,14 @@ MOCK_FB_SERVICES: dict[str, dict[str, Any]] = { }, "UserInterface1": { "GetInfo": {}, + "X_AVM-DE_GetInfo": { + "NewX_AVM-DE_AutoUpdateMode": "notify", + "NewX_AVM-DE_UpdateTime": "2026-05-17T18:54:37+02:00", + "NewX_AVM-DE_LastFwVersion": "256.08.20,124233", + "NewX_AVM-DE_LastInfoUrl": "http://download.avm.de/fritzbox/fritzbox-7530-ax/deutschland/fritz.os/info_en.txt", + "NewX_AVM-DE_CurrentFwVersion": "256.08.25", + "NewX_AVM-DE_UpdateSuccessful": "succeeded", + }, }, "WANCommonIFC1": { "GetCommonLinkProperties": { diff --git a/tests/components/fritz/snapshots/test_diagnostics.ambr b/tests/components/fritz/snapshots/test_diagnostics.ambr index f67aaf40bcd9..af5fe8460dc1 100644 --- a/tests/components/fritz/snapshots/test_diagnostics.ambr +++ b/tests/components/fritz/snapshots/test_diagnostics.ambr @@ -25,6 +25,7 @@ 'NAS': 'none', 'Phone': 'readwrite', }), + 'device_uptime_hours': 699, 'discovered_services': list([ 'DeviceInfo1', 'Hosts1', @@ -43,6 +44,14 @@ 'X_AVM-DE_HostFilter1', 'X_AVM-DE_UPnP1', ]), + 'firmware_extra_infos': dict({ + 'NewX_AVM-DE_AutoUpdateMode': 'notify', + 'NewX_AVM-DE_CurrentFwVersion': '256.08.25', + 'NewX_AVM-DE_LastFwVersion': '256.08.20,124233', + 'NewX_AVM-DE_LastInfoUrl': 'http://download.avm.de/fritzbox/fritzbox-7530-ax/deutschland/fritz.os/info_en.txt', + 'NewX_AVM-DE_UpdateSuccessful': 'succeeded', + 'NewX_AVM-DE_UpdateTime': '2026-05-17T18:54:37+02:00', + }), 'is_router': True, 'last_exception': None, 'last_update success': True,