diff --git a/homeassistant/components/vicare/diagnostics.py b/homeassistant/components/vicare/diagnostics.py index 7695c304451e..b3a64fdad546 100644 --- a/homeassistant/components/vicare/diagnostics.py +++ b/homeassistant/components/vicare/diagnostics.py @@ -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 { diff --git a/tests/components/vicare/conftest.py b/tests/components/vicare/conftest.py index c8feec8dc749..6709df2dbe95 100644 --- a/tests/components/vicare/conftest.py +++ b/tests/components/vicare/conftest.py @@ -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: diff --git a/tests/components/vicare/snapshots/test_diagnostics.ambr b/tests/components/vicare/snapshots/test_diagnostics.ambr index e0ca73c7c5e4..3844a3f248cb 100644 --- a/tests/components/vicare/snapshots/test_diagnostics.ambr +++ b/tests/components/vicare/snapshots/test_diagnostics.ambr @@ -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({