Improve lists in integrations [C-D] (#113072)
This commit is contained in:
parent
4d77bec681
commit
c75342bd9a
32 changed files with 276 additions and 311 deletions
|
@ -22,25 +22,24 @@ async def async_get_config_entry_diagnostics(
|
|||
"""Return diagnostics for a config entry."""
|
||||
gateways: list[HomeControl] = hass.data[DOMAIN][entry.entry_id]["gateways"]
|
||||
|
||||
device_info = []
|
||||
for gateway in gateways:
|
||||
device_info.append(
|
||||
{
|
||||
"gateway": {
|
||||
"local_connection": gateway.gateway.local_connection,
|
||||
"firmware_version": gateway.gateway.firmware_version,
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"device_id": device_id,
|
||||
"device_model_uid": properties.device_model_uid,
|
||||
"device_type": properties.device_type,
|
||||
"name": properties.name,
|
||||
}
|
||||
for device_id, properties in gateway.devices.items()
|
||||
],
|
||||
}
|
||||
)
|
||||
device_info = [
|
||||
{
|
||||
"gateway": {
|
||||
"local_connection": gateway.gateway.local_connection,
|
||||
"firmware_version": gateway.gateway.firmware_version,
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"device_id": device_id,
|
||||
"device_model_uid": properties.device_model_uid,
|
||||
"device_type": properties.device_type,
|
||||
"name": properties.name,
|
||||
}
|
||||
for device_id, properties in gateway.devices.items()
|
||||
],
|
||||
}
|
||||
for gateway in gateways
|
||||
]
|
||||
|
||||
diag_data = {
|
||||
"entry": async_redact_data(entry.as_dict(), TO_REDACT),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue