mirror of
https://github.com/home-assistant/core.git
synced 2026-08-31 18:24:50 -05:00
Use all_devices in ViCare diagnostics for completeness (#169429)
This commit is contained in:
committed by
Paulus Schoutsen
parent
2d66ebe54a
commit
4f78bbccc0
@@ -23,7 +23,7 @@ async def async_get_config_entry_diagnostics(
|
||||
"""Dump devices."""
|
||||
return [
|
||||
json.loads(device.dump_secure())
|
||||
for device in entry.runtime_data.client.devices
|
||||
for device in entry.runtime_data.client.all_devices
|
||||
]
|
||||
|
||||
return {
|
||||
|
||||
@@ -45,6 +45,23 @@ class MockPyViCare:
|
||||
"Online",
|
||||
)
|
||||
)
|
||||
# Simulate a device with an unsupported deviceType that PyViCare's
|
||||
# `devices` filter would drop but should still appear in `all_devices`
|
||||
# (used by diagnostics).
|
||||
self.all_devices = [
|
||||
*self.devices,
|
||||
PyViCareDeviceConfig(
|
||||
MockViCareService(
|
||||
"installation_unsupported",
|
||||
"gateway_unsupported",
|
||||
"device_unsupported",
|
||||
Fixture(set(), "vicare/dummy-device-no-serial.json"),
|
||||
),
|
||||
"deviceId_unsupported",
|
||||
"unsupported_model",
|
||||
"Online",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class MockViCareService:
|
||||
|
||||
@@ -4720,6 +4720,18 @@
|
||||
'type': None,
|
||||
}),
|
||||
}),
|
||||
dict({
|
||||
'data': list([
|
||||
]),
|
||||
'device': dict({
|
||||
'id': 'deviceId_unsupported',
|
||||
'modelId': 'unsupported_model',
|
||||
'roles': list([
|
||||
]),
|
||||
'status': 'Online',
|
||||
'type': None,
|
||||
}),
|
||||
}),
|
||||
]),
|
||||
'entry': dict({
|
||||
'data': dict({
|
||||
|
||||
Reference in New Issue
Block a user