Extend diagnostics data in Fritz!Tools (#65573)

pull/65598/head
Michael 2022-02-03 22:36:36 +01:00 committed by Paulus Schoutsen
parent 2928935838
commit 3a1a12b13e
2 changed files with 27 additions and 0 deletions

View File

@ -574,6 +574,13 @@ class AvmWrapper(FritzBoxTools):
partial(self.get_wan_dsl_interface_config)
)
async def async_get_wan_link_properties(self) -> dict[str, Any]:
"""Call WANCommonInterfaceConfig service."""
return await self.hass.async_add_executor_job(
partial(self.get_wan_link_properties)
)
async def async_get_port_mapping(self, con_type: str, index: int) -> dict[str, Any]:
"""Call GetGenericPortMappingEntry action."""
@ -676,6 +683,13 @@ class AvmWrapper(FritzBoxTools):
return self._service_call_action("WANDSLInterfaceConfig", "1", "GetInfo")
def get_wan_link_properties(self) -> dict[str, Any]:
"""Call WANCommonInterfaceConfig service."""
return self._service_call_action(
"WANCommonInterfaceConfig", "1", "GetCommonLinkProperties"
)
def set_wlan_configuration(self, index: int, turn_on: bool) -> dict[str, Any]:
"""Call SetEnable action from WLANConfiguration service."""

View File

@ -29,6 +29,19 @@ async def async_get_config_entry_diagnostics(
"mesh_role": avm_wrapper.mesh_role,
"last_update success": avm_wrapper.last_update_success,
"last_exception": avm_wrapper.last_exception,
"discovered_services": list(avm_wrapper.connection.services),
"client_devices": [
{
"connected_to": device.connected_to,
"connection_type": device.connection_type,
"hostname": device.hostname,
"is_connected": device.is_connected,
"last_activity": device.last_activity,
"wan_access": device.wan_access,
}
for _, device in avm_wrapper.devices.items()
],
"wan_link_properties": await avm_wrapper.async_get_wan_link_properties(),
},
}