diff --git a/homeassistant/components/fritz/common.py b/homeassistant/components/fritz/common.py index fa4096cb4ff..2cd6616f134 100644 --- a/homeassistant/components/fritz/common.py +++ b/homeassistant/components/fritz/common.py @@ -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.""" diff --git a/homeassistant/components/fritz/diagnostics.py b/homeassistant/components/fritz/diagnostics.py index 4305ee4d7cb..f35eca6b914 100644 --- a/homeassistant/components/fritz/diagnostics.py +++ b/homeassistant/components/fritz/diagnostics.py @@ -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(), }, }