1 """Diagnostics support for AVM FRITZ!Box."""
3 from __future__
import annotations
12 from .const
import DOMAIN
13 from .coordinator
import AvmWrapper
15 TO_REDACT = {CONF_USERNAME, CONF_PASSWORD}
19 hass: HomeAssistant, entry: ConfigEntry
21 """Return diagnostics for a config entry."""
22 avm_wrapper: AvmWrapper = hass.data[DOMAIN][entry.entry_id]
27 "model": avm_wrapper.model,
28 "unique_id": avm_wrapper.unique_id.replace(
29 avm_wrapper.unique_id[6:11],
"XX:XX"
31 "current_firmware": avm_wrapper.current_firmware,
32 "latest_firmware": avm_wrapper.latest_firmware,
33 "update_available": avm_wrapper.update_available,
34 "connection_type": avm_wrapper.device_conn_type,
35 "is_router": avm_wrapper.device_is_router,
36 "mesh_role": avm_wrapper.mesh_role,
37 "last_update success": avm_wrapper.last_update_success,
38 "last_exception": avm_wrapper.last_exception,
39 "discovered_services":
list(avm_wrapper.connection.services),
42 "connected_to": device.connected_to,
43 "connection_type": device.connection_type,
44 "hostname": device.hostname,
45 "is_connected": device.is_connected,
46 "last_activity": device.last_activity,
47 "wan_access": device.wan_access,
49 for _, device
in avm_wrapper.devices.items()
51 "wan_link_properties": await avm_wrapper.async_get_wan_link_properties(),
dict async_redact_data(Mapping data, Iterable[Any] to_redact)
dict[str, Any] async_get_config_entry_diagnostics(HomeAssistant hass, ConfigEntry entry)