"""Tests for the diagnostics data provided by the Plugwise integration.""" from unittest.mock import MagicMock from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_config_entry from tests.typing import ClientSessionGenerator async def test_diagnostics( hass: HomeAssistant, hass_client: ClientSessionGenerator, mock_smile_adam: MagicMock, init_integration: MockConfigEntry, ) -> None: """Test diagnostics.""" assert await get_diagnostics_for_config_entry( hass, hass_client, init_integration ) == { "gateway": { "smile_name": "Adam", "gateway_id": "fe799307f1624099878210aa0b9f1475", "heater_id": "90986d591dcd426cae3ec3e8111ff730", "cooling_present": False, "notifications": { "af82e4ccf9c548528166d38e560662a4": { "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." } }, }, "devices": { "02cf28bfec924855854c544690a609ef": { "available": True, "dev_class": "vcr", "firmware": "2019-06-21T02:00:00+02:00", "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "name": "NVR", "sensors": { "electricity_consumed": 34.0, "electricity_consumed_interval": 9.15, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"lock": True, "relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A15", }, "21f2b542c49845e6bb416884c55778d6": { "available": True, "dev_class": "game_console", "firmware": "2019-06-21T02:00:00+02:00", "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "name": "Playstation Smart Plug", "sensors": { "electricity_consumed": 82.6, "electricity_consumed_interval": 8.6, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"lock": False, "relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A12", }, "4a810418d5394b3f82727340b91ba740": { "available": True, "dev_class": "router", "firmware": "2019-06-21T02:00:00+02:00", "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "name": "USG Smart Plug", "sensors": { "electricity_consumed": 8.5, "electricity_consumed_interval": 0.0, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"lock": True, "relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A16", }, "675416a629f343c495449970e2ca37b5": { "available": True, "dev_class": "router", "firmware": "2019-06-21T02:00:00+02:00", "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "name": "Ziggo Modem", "sensors": { "electricity_consumed": 12.2, "electricity_consumed_interval": 2.97, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"lock": True, "relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A01", }, "680423ff840043738f42cc7f1ff97a36": { "available": True, "dev_class": "thermo_sensor", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom/Floor", "name": "Thermostatic Radiator Badkamer", "sensors": { "battery": 51, "setpoint": 14.0, "temperature": 19.1, "temperature_difference": -0.4, "valve_position": 0.0, }, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A17", }, "6a3bf693d05e48e0b460c815a4fdd09d": { "active_preset": "asleep", "available": True, "available_schedules": [ "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", "CV Jessie", ], "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "last_used": "CV Jessie", "location": "82fa13f017d240daa0d0ea1775420f24", "mode": "auto", "model": "Lisa", "name": "Zone Thermostat Jessie", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "CV Jessie", "sensors": {"battery": 37, "setpoint": 15.0, "temperature": 17.2}, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "thermostat": { "lower_bound": 0.0, "resolution": 0.01, "setpoint": 15.0, "upper_bound": 99.9, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A03", }, "78d1126fc4c743db81b61c20e88342a7": { "available": True, "dev_class": "central_heating_pump", "firmware": "2019-06-21T02:00:00+02:00", "location": "c50f167537524366a5af7aa3942feb1e", "model": "Plug", "name": "CV Pomp", "sensors": { "electricity_consumed": 35.6, "electricity_consumed_interval": 7.37, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A05", }, "90986d591dcd426cae3ec3e8111ff730": { "binary_sensors": {"heating_state": True}, "dev_class": "heater_central", "location": "1f9dcf83fd4e4b66b72ff787957bfe5d", "model": "Unknown", "name": "OnOff", "sensors": { "intended_boiler_temperature": 70.0, "modulation_level": 1, "water_temperature": 70.0, }, }, "a28f588dc4a049a483fd03a30361ad3a": { "available": True, "dev_class": "settop", "firmware": "2019-06-21T02:00:00+02:00", "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "name": "Fibaro HC2", "sensors": { "electricity_consumed": 12.5, "electricity_consumed_interval": 3.8, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"lock": True, "relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A13", }, "a2c3583e0a6349358998b760cea82d2a": { "available": True, "dev_class": "thermo_sensor", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "12493538af164a409c6a1c79e38afe1c", "model": "Tom/Floor", "name": "Bios Cv Thermostatic Radiator ", "sensors": { "battery": 62, "setpoint": 13.0, "temperature": 17.2, "temperature_difference": -0.2, "valve_position": 0.0, }, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A09", }, "b310b72a0e354bfab43089919b9a88bf": { "available": True, "dev_class": "thermo_sensor", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "c50f167537524366a5af7aa3942feb1e", "model": "Tom/Floor", "name": "Floor kraan", "sensors": { "setpoint": 21.5, "temperature": 26.0, "temperature_difference": 3.5, "valve_position": 100, }, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A02", }, "b59bcebaf94b499ea7d46e4a66fb62d8": { "active_preset": "home", "available": True, "available_schedules": [ "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", "CV Jessie", ], "dev_class": "zone_thermostat", "firmware": "2016-08-02T02:00:00+02:00", "hardware": "255", "last_used": "GF7 Woonkamer", "location": "c50f167537524366a5af7aa3942feb1e", "mode": "auto", "model": "Lisa", "name": "Zone Lisa WK", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "GF7 Woonkamer", "sensors": {"battery": 34, "setpoint": 21.5, "temperature": 20.9}, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "thermostat": { "lower_bound": 0.0, "resolution": 0.01, "setpoint": 21.5, "upper_bound": 99.9, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A07", }, "cd0ddb54ef694e11ac18ed1cbce5dbbd": { "available": True, "dev_class": "vcr", "firmware": "2019-06-21T02:00:00+02:00", "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "name": "NAS", "sensors": { "electricity_consumed": 16.5, "electricity_consumed_interval": 0.5, "electricity_produced": 0.0, "electricity_produced_interval": 0.0, }, "switches": {"lock": True, "relay": True}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A14", }, "d3da73bde12a47d5a6b8f9dad971f2ec": { "available": True, "dev_class": "thermo_sensor", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Tom/Floor", "name": "Thermostatic Radiator Jessie", "sensors": { "battery": 62, "setpoint": 15.0, "temperature": 17.1, "temperature_difference": 0.1, "valve_position": 0.0, }, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A10", }, "df4a4a8169904cdb9c03d61a21f42140": { "active_preset": "away", "available": True, "available_schedules": [ "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", "CV Jessie", ], "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "last_used": "Badkamer Schema", "location": "12493538af164a409c6a1c79e38afe1c", "mode": "heat", "model": "Lisa", "name": "Zone Lisa Bios", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "None", "sensors": {"battery": 67, "setpoint": 13.0, "temperature": 16.5}, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "thermostat": { "lower_bound": 0.0, "resolution": 0.01, "setpoint": 13.0, "upper_bound": 99.9, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A06", }, "e7693eb9582644e5b865dba8d4447cf1": { "active_preset": "no_frost", "available": True, "available_schedules": [ "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", "CV Jessie", ], "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "last_used": "Badkamer Schema", "location": "446ac08dd04d4eff8ac57489757b7314", "mode": "heat", "model": "Tom/Floor", "name": "CV Kraan Garage", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "None", "sensors": { "battery": 68, "setpoint": 5.5, "temperature": 15.6, "temperature_difference": 0.0, "valve_position": 0.0, }, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "thermostat": { "lower_bound": 0.0, "resolution": 0.01, "setpoint": 5.5, "upper_bound": 100.0, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A11", }, "f1fee6043d3642a9b0a65297455f008e": { "active_preset": "away", "available": True, "available_schedules": [ "CV Roan", "Bios Schema met Film Avond", "GF7 Woonkamer", "Badkamer Schema", "CV Jessie", ], "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "last_used": "Badkamer Schema", "location": "08963fec7c53423ca5680aa4cb502c63", "mode": "auto", "model": "Lisa", "name": "Zone Thermostat Badkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Badkamer Schema", "sensors": {"battery": 92, "setpoint": 14.0, "temperature": 18.9}, "temperature_offset": { "lower_bound": -2.0, "resolution": 0.1, "setpoint": 0.0, "upper_bound": 2.0, }, "thermostat": { "lower_bound": 0.0, "resolution": 0.01, "setpoint": 14.0, "upper_bound": 99.9, }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A08", }, "fe799307f1624099878210aa0b9f1475": { "binary_sensors": {"plugwise_notification": True}, "dev_class": "gateway", "firmware": "3.0.15", "hardware": "AME Smile 2.0 board", "location": "1f9dcf83fd4e4b66b72ff787957bfe5d", "mac_address": "012345670001", "model": "Gateway", "name": "Adam", "select_regulation_mode": "heating", "sensors": {"outdoor_temperature": 7.81}, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670101", }, }, }