1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-06 22:36:33 +01:00

Add extra device info to FRITZ!Box Tools diagnostics (#172647)

This commit is contained in:
Michael
2026-06-01 12:19:09 +02:00
committed by GitHub
parent fed946760d
commit e03bc6faa5
4 changed files with 31 additions and 0 deletions
@@ -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)
@@ -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,
+8
View File
@@ -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": {
@@ -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,