From 0c243d699c98f93672283c6249c97935ab968db7 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 23 May 2024 16:22:31 +0200 Subject: [PATCH] Use SnapshotAssertion in rainmachine diagnostic tests (#117979) * Use SnapshotAssertion in rainmachine diagnostic tests * Force entry_id * Adjust * Fix incorrect fixtures * Adjust --- tests/components/rainmachine/conftest.py | 23 +- .../rainmachine/fixtures/zones_details.json | 482 ++++ .../snapshots/test_diagnostics.ambr | 2279 +++++++++++++++++ .../rainmachine/test_diagnostics.py | 1233 +-------- 4 files changed, 2792 insertions(+), 1225 deletions(-) create mode 100644 tests/components/rainmachine/fixtures/zones_details.json create mode 100644 tests/components/rainmachine/snapshots/test_diagnostics.ambr diff --git a/tests/components/rainmachine/conftest.py b/tests/components/rainmachine/conftest.py index 9b0f8f0442a..717d74b421b 100644 --- a/tests/components/rainmachine/conftest.py +++ b/tests/components/rainmachine/conftest.py @@ -1,6 +1,7 @@ """Define test fixtures for RainMachine.""" import json +from typing import Any from unittest.mock import AsyncMock, patch import pytest @@ -32,7 +33,12 @@ def config_fixture(hass): @pytest.fixture(name="config_entry") def config_entry_fixture(hass, config, controller_mac): """Define a config entry fixture.""" - entry = MockConfigEntry(domain=DOMAIN, unique_id=controller_mac, data=config) + entry = MockConfigEntry( + domain=DOMAIN, + unique_id=controller_mac, + data=config, + entry_id="81bd010ed0a63b705f6da8407cb26d4b", + ) entry.add_to_hass(hass) return entry @@ -100,7 +106,9 @@ def data_machine_firmare_update_status_fixture(): @pytest.fixture(name="data_programs", scope="package") def data_programs_fixture(): """Define program data.""" - return json.loads(load_fixture("programs_data.json", "rainmachine")) + raw_data = json.loads(load_fixture("programs_data.json", "rainmachine")) + # This replicate the process from `regenmaschine` to convert list to dict + return {program["uid"]: program for program in raw_data} @pytest.fixture(name="data_provision_settings", scope="package") @@ -124,7 +132,16 @@ def data_restrictions_universal_fixture(): @pytest.fixture(name="data_zones", scope="package") def data_zones_fixture(): """Define zone data.""" - return json.loads(load_fixture("zones_data.json", "rainmachine")) + raw_data = json.loads(load_fixture("zones_data.json", "rainmachine")) + # This replicate the process from `regenmaschine` to convert list to dict + zone_details = json.loads(load_fixture("zones_details.json", "rainmachine")) + + zones: dict[int, dict[str, Any]] = {} + for zone in raw_data: + [extra] = [z for z in zone_details if z["uid"] == zone["uid"]] + zones[zone["uid"]] = {**zone, **extra} + + return zones @pytest.fixture(name="setup_rainmachine") diff --git a/tests/components/rainmachine/fixtures/zones_details.json b/tests/components/rainmachine/fixtures/zones_details.json new file mode 100644 index 00000000000..cb5fec45879 --- /dev/null +++ b/tests/components/rainmachine/fixtures/zones_details.json @@ -0,0 +1,482 @@ +[ + { + "uid": 1, + "name": "Landscaping", + "valveid": 1, + "ETcoef": 0.80000000000000004, + "active": true, + "type": 4, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 5, + "group_id": 4, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.17000000000000001, + "rootDepth": 229, + "minRuntime": 0, + "appEfficiency": 0.75, + "isTallPlant": true, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 8.3800000000000008, + "maxAllowedDepletion": 0.5, + "precipitationRate": 25.399999999999999, + "currentFieldCapacity": 16.030000000000001, + "area": 92.900001525878906, + "referenceTime": 1243, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": null, + "soilIntakeRate": 10.16 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 2, + "name": "Flower Box", + "valveid": 2, + "ETcoef": 0.80000000000000004, + "active": true, + "type": 5, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 5, + "group_id": 3, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.17000000000000001, + "rootDepth": 457, + "minRuntime": 5, + "appEfficiency": 0.80000000000000004, + "isTallPlant": true, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 8.3800000000000008, + "maxAllowedDepletion": 0.34999999999999998, + "precipitationRate": 12.699999999999999, + "currentFieldCapacity": 22.390000000000001, + "area": 92.900000000000006, + "referenceTime": 2680, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": null, + "soilIntakeRate": 10.16 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 3, + "name": "TEST", + "valveid": 3, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 9, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 700, + "minRuntime": 0, + "appEfficiency": 0.69999999999999996, + "isTallPlant": true, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.59999999999999998, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 113.40000000000001, + "area": 92.900000000000006, + "referenceTime": 380, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": null, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 4, + "name": "Zone 4", + "valveid": 4, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 5, + "name": "Zone 5", + "valveid": 5, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 6, + "name": "Zone 6", + "valveid": 6, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 7, + "name": "Zone 7", + "valveid": 7, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 8, + "name": "Zone 8", + "valveid": 8, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 9, + "name": "Zone 9", + "valveid": 9, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 10, + "name": "Zone 10", + "valveid": 10, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 11, + "name": "Zone 11", + "valveid": 11, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + }, + { + "uid": 12, + "name": "Zone 12", + "valveid": 12, + "ETcoef": 0.80000000000000004, + "active": false, + "type": 2, + "internet": true, + "savings": 100, + "slope": 1, + "sun": 1, + "soil": 1, + "group_id": 1, + "history": true, + "master": false, + "before": 0, + "after": 0, + "waterSense": { + "fieldCapacity": 0.29999999999999999, + "rootDepth": 203, + "minRuntime": -1, + "appEfficiency": 0.69999999999999996, + "isTallPlant": false, + "permWilting": 0.029999999999999999, + "allowedSurfaceAcc": 6.5999999999999996, + "maxAllowedDepletion": 0.40000000000000002, + "precipitationRate": 35.560000000000002, + "currentFieldCapacity": 21.920000000000002, + "area": 92.900000000000006, + "referenceTime": 761, + "detailedMonthsKc": [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + ], + "flowrate": 0.0, + "soilIntakeRate": 5.0800000000000001 + }, + "customSoilPreset": null, + "customVegetationPreset": null, + "customSprinklerPreset": null + } +] diff --git a/tests/components/rainmachine/snapshots/test_diagnostics.ambr b/tests/components/rainmachine/snapshots/test_diagnostics.ambr new file mode 100644 index 00000000000..9b5b5edc0c4 --- /dev/null +++ b/tests/components/rainmachine/snapshots/test_diagnostics.ambr @@ -0,0 +1,2279 @@ +# serializer version: 1 +# name: test_entry_diagnostics + dict({ + 'data': dict({ + 'controller_diagnostics': dict({ + 'bootCompleted': True, + 'cloudStatus': 0, + 'cpuUsage': 1, + 'gatewayAddress': '172.16.20.1', + 'hasWifi': True, + 'internetStatus': True, + 'lastCheck': '2022-08-07 11:59:35', + 'lastCheckTimestamp': 1659895175, + 'locationStatus': True, + 'memUsage': 16196, + 'networkStatus': True, + 'softwareVersion': '4.0.1144', + 'standaloneMode': False, + 'timeStatus': True, + 'uptime': '3 days, 18:14:14', + 'uptimeSeconds': 324854, + 'weatherStatus': True, + 'wifiMode': None, + 'wizardHasRun': True, + }), + 'coordinator': dict({ + 'api.versions': dict({ + 'apiVer': '4.6.1', + 'hwVer': '3', + 'swVer': '4.0.1144', + }), + 'machine.firmware_update_status': dict({ + 'lastUpdateCheck': '2022-07-14 13:01:28', + 'lastUpdateCheckTimestamp': 1657825288, + 'packageDetails': list([ + ]), + 'update': False, + 'updateStatus': 1, + }), + 'programs': dict({ + '1': dict({ + 'active': True, + 'coef': 0, + 'cs_on': False, + 'cycles': 0, + 'delay': 0, + 'delay_on': False, + 'endDate': None, + 'freq_modified': 0, + 'frequency': dict({ + 'param': '0', + 'type': 0, + }), + 'futureField1': 0, + 'ignoreInternetWeather': False, + 'name': 'Morning', + 'nextRun': '2018-06-04', + 'simulationExpired': False, + 'soak': 0, + 'startDate': '2018-04-28', + 'startTime': '06:00', + 'startTimeParams': dict({ + 'offsetMinutes': 0, + 'offsetSign': 0, + 'type': 0, + }), + 'status': 0, + 'uid': 1, + 'useWaterSense': False, + 'wateringTimes': list([ + dict({ + 'active': True, + 'duration': 0, + 'id': 1, + 'minRuntimeCoef': 1, + 'name': 'Landscaping', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': True, + 'duration': 0, + 'id': 2, + 'minRuntimeCoef': 1, + 'name': 'Flower Box', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 3, + 'minRuntimeCoef': 1, + 'name': 'TEST', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 4, + 'minRuntimeCoef': 1, + 'name': 'Zone 4', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 5, + 'minRuntimeCoef': 1, + 'name': 'Zone 5', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 6, + 'minRuntimeCoef': 1, + 'name': 'Zone 6', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 7, + 'minRuntimeCoef': 1, + 'name': 'Zone 7', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 8, + 'minRuntimeCoef': 1, + 'name': 'Zone 8', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 9, + 'minRuntimeCoef': 1, + 'name': 'Zone 9', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 10, + 'minRuntimeCoef': 1, + 'name': 'Zone 10', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 11, + 'minRuntimeCoef': 1, + 'name': 'Zone 11', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 12, + 'minRuntimeCoef': 1, + 'name': 'Zone 12', + 'order': -1, + 'userPercentage': 1, + }), + ]), + 'yearlyRecurring': True, + }), + '2': dict({ + 'active': False, + 'coef': 0, + 'cs_on': False, + 'cycles': 0, + 'delay': 0, + 'delay_on': False, + 'endDate': None, + 'freq_modified': 0, + 'frequency': dict({ + 'param': '0', + 'type': 0, + }), + 'futureField1': 0, + 'ignoreInternetWeather': False, + 'name': 'Evening', + 'nextRun': '2018-06-04', + 'simulationExpired': False, + 'soak': 0, + 'startDate': '2018-04-28', + 'startTime': '06:00', + 'startTimeParams': dict({ + 'offsetMinutes': 0, + 'offsetSign': 0, + 'type': 0, + }), + 'status': 0, + 'uid': 2, + 'useWaterSense': False, + 'wateringTimes': list([ + dict({ + 'active': True, + 'duration': 0, + 'id': 1, + 'minRuntimeCoef': 1, + 'name': 'Landscaping', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': True, + 'duration': 0, + 'id': 2, + 'minRuntimeCoef': 1, + 'name': 'Flower Box', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 3, + 'minRuntimeCoef': 1, + 'name': 'TEST', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 4, + 'minRuntimeCoef': 1, + 'name': 'Zone 4', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 5, + 'minRuntimeCoef': 1, + 'name': 'Zone 5', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 6, + 'minRuntimeCoef': 1, + 'name': 'Zone 6', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 7, + 'minRuntimeCoef': 1, + 'name': 'Zone 7', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 8, + 'minRuntimeCoef': 1, + 'name': 'Zone 8', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 9, + 'minRuntimeCoef': 1, + 'name': 'Zone 9', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 10, + 'minRuntimeCoef': 1, + 'name': 'Zone 10', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 11, + 'minRuntimeCoef': 1, + 'name': 'Zone 11', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 12, + 'minRuntimeCoef': 1, + 'name': 'Zone 12', + 'order': -1, + 'userPercentage': 1, + }), + ]), + 'yearlyRecurring': True, + }), + }), + 'provision.settings': dict({ + 'location': dict({ + 'address': 'Default', + 'doyDownloaded': True, + 'elevation': '**REDACTED**', + 'et0Average': 6.578, + 'krs': 0.16, + 'latitude': '**REDACTED**', + 'longitude': '**REDACTED**', + 'name': 'Home', + 'rainSensitivity': 0.8, + 'state': 'Default', + 'stationDownloaded': True, + 'stationID': '**REDACTED**', + 'stationName': '**REDACTED**', + 'stationSource': '**REDACTED**', + 'timezone': '**REDACTED**', + 'windSensitivity': 0.5, + 'wsDays': 2, + 'zip': None, + }), + 'system': dict({ + 'allowAlexaDiscovery': False, + 'automaticUpdates': True, + 'databasePath': '/rainmachine-app/DB/Default', + 'defaultZoneWateringDuration': 300, + 'hardwareVersion': 3, + 'httpEnabled': True, + 'localValveCount': 12, + 'masterValveAfter': 0, + 'masterValveBefore': 0, + 'maxLEDBrightness': 40, + 'maxWateringCoef': 2, + 'minLEDBrightness': 0, + 'minWateringDurationThreshold': 0, + 'mixerHistorySize': 365, + 'netName': 'Home', + 'parserDataSizeInDays': 6, + 'parserHistorySize': 365, + 'programListShowInactive': True, + 'programSingleSchedule': False, + 'programZonesShowInactive': False, + 'rainSensorIsNormallyClosed': True, + 'rainSensorRainStart': None, + 'rainSensorSnoozeDuration': 0, + 'runParsersBeforePrograms': True, + 'selfTest': False, + 'showRestrictionsOnLed': False, + 'simulatorHistorySize': 0, + 'softwareRainSensorMinQPF': 5, + 'standaloneMode': False, + 'touchAdvanced': False, + 'touchAuthAPSeconds': 60, + 'touchCyclePrograms': True, + 'touchLongPressTimeout': 3, + 'touchProgramToRun': None, + 'touchSleepTimeout': 10, + 'uiUnitsMetric': False, + 'useBonjourService': True, + 'useCommandLineArguments': False, + 'useCorrectionForPast': True, + 'useMasterValve': False, + 'useRainSensor': False, + 'useSoftwareRainSensor': False, + 'vibration': False, + 'waterLogHistorySize': 365, + 'wizardHasRun': True, + 'zoneDuration': list([ + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + ]), + 'zoneListShowInactive': True, + }), + }), + 'restrictions.current': dict({ + 'freeze': False, + 'hourly': False, + 'month': False, + 'rainDelay': False, + 'rainDelayCounter': -1, + 'rainSensor': False, + 'weekDay': False, + }), + 'restrictions.universal': dict({ + 'freezeProtectEnabled': True, + 'freezeProtectTemp': 2, + 'hotDaysExtraWatering': False, + 'noWaterInMonths': '000000000000', + 'noWaterInWeekDays': '0000000', + 'rainDelayDuration': 0, + 'rainDelayStartTime': 1524854551, + }), + 'zones': dict({ + '1': dict({ + 'ETcoef': 0.8, + 'active': True, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 4, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Landscaping', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 5, + 'state': 0, + 'sun': 1, + 'type': 4, + 'uid': 1, + 'userDuration': 0, + 'valveid': 1, + 'waterSense': dict({ + 'allowedSurfaceAcc': 8.38, + 'appEfficiency': 0.75, + 'area': 92.9000015258789, + 'currentFieldCapacity': 16.03, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.17, + 'flowrate': None, + 'isTallPlant': True, + 'maxAllowedDepletion': 0.5, + 'minRuntime': 0, + 'permWilting': 0.03, + 'precipitationRate': 25.4, + 'referenceTime': 1243, + 'rootDepth': 229, + 'soilIntakeRate': 10.16, + }), + }), + '10': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 10', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 10, + 'userDuration': 0, + 'valveid': 10, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '11': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 11', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 11, + 'userDuration': 0, + 'valveid': 11, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '12': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 12', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 12, + 'userDuration': 0, + 'valveid': 12, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '2': dict({ + 'ETcoef': 0.8, + 'active': True, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 3, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Flower Box', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 5, + 'state': 0, + 'sun': 1, + 'type': 5, + 'uid': 2, + 'userDuration': 0, + 'valveid': 2, + 'waterSense': dict({ + 'allowedSurfaceAcc': 8.38, + 'appEfficiency': 0.8, + 'area': 92.9, + 'currentFieldCapacity': 22.39, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.17, + 'flowrate': None, + 'isTallPlant': True, + 'maxAllowedDepletion': 0.35, + 'minRuntime': 5, + 'permWilting': 0.03, + 'precipitationRate': 12.7, + 'referenceTime': 2680, + 'rootDepth': 457, + 'soilIntakeRate': 10.16, + }), + }), + '3': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'TEST', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 9, + 'uid': 3, + 'userDuration': 0, + 'valveid': 3, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 113.4, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': None, + 'isTallPlant': True, + 'maxAllowedDepletion': 0.6, + 'minRuntime': 0, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 380, + 'rootDepth': 700, + 'soilIntakeRate': 5.08, + }), + }), + '4': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 4', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 4, + 'userDuration': 0, + 'valveid': 4, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '5': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 5', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 5, + 'userDuration': 0, + 'valveid': 5, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '6': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 6', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 6, + 'userDuration': 0, + 'valveid': 6, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '7': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 7', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 7, + 'userDuration': 0, + 'valveid': 7, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '8': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 8', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 8, + 'userDuration': 0, + 'valveid': 8, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '9': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 9', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 9, + 'userDuration': 0, + 'valveid': 9, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + }), + }), + }), + 'entry': dict({ + 'data': dict({ + 'ip_address': '192.168.1.100', + 'password': '**REDACTED**', + 'port': 8080, + 'ssl': True, + }), + 'disabled_by': None, + 'domain': 'rainmachine', + 'entry_id': '81bd010ed0a63b705f6da8407cb26d4b', + 'minor_version': 1, + 'options': dict({ + 'allow_inactive_zones_to_run': False, + 'use_app_run_times': False, + 'zone_run_time': 600, + }), + 'pref_disable_new_entities': False, + 'pref_disable_polling': False, + 'source': 'user', + 'title': 'Mock Title', + 'unique_id': '**REDACTED**', + 'version': 2, + }), + }) +# --- +# name: test_entry_diagnostics_failed_controller_diagnostics + dict({ + 'data': dict({ + 'controller_diagnostics': None, + 'coordinator': dict({ + 'api.versions': dict({ + 'apiVer': '4.6.1', + 'hwVer': '3', + 'swVer': '4.0.1144', + }), + 'machine.firmware_update_status': dict({ + 'lastUpdateCheck': '2022-07-14 13:01:28', + 'lastUpdateCheckTimestamp': 1657825288, + 'packageDetails': list([ + ]), + 'update': False, + 'updateStatus': 1, + }), + 'programs': dict({ + '1': dict({ + 'active': True, + 'coef': 0, + 'cs_on': False, + 'cycles': 0, + 'delay': 0, + 'delay_on': False, + 'endDate': None, + 'freq_modified': 0, + 'frequency': dict({ + 'param': '0', + 'type': 0, + }), + 'futureField1': 0, + 'ignoreInternetWeather': False, + 'name': 'Morning', + 'nextRun': '2018-06-04', + 'simulationExpired': False, + 'soak': 0, + 'startDate': '2018-04-28', + 'startTime': '06:00', + 'startTimeParams': dict({ + 'offsetMinutes': 0, + 'offsetSign': 0, + 'type': 0, + }), + 'status': 0, + 'uid': 1, + 'useWaterSense': False, + 'wateringTimes': list([ + dict({ + 'active': True, + 'duration': 0, + 'id': 1, + 'minRuntimeCoef': 1, + 'name': 'Landscaping', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': True, + 'duration': 0, + 'id': 2, + 'minRuntimeCoef': 1, + 'name': 'Flower Box', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 3, + 'minRuntimeCoef': 1, + 'name': 'TEST', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 4, + 'minRuntimeCoef': 1, + 'name': 'Zone 4', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 5, + 'minRuntimeCoef': 1, + 'name': 'Zone 5', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 6, + 'minRuntimeCoef': 1, + 'name': 'Zone 6', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 7, + 'minRuntimeCoef': 1, + 'name': 'Zone 7', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 8, + 'minRuntimeCoef': 1, + 'name': 'Zone 8', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 9, + 'minRuntimeCoef': 1, + 'name': 'Zone 9', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 10, + 'minRuntimeCoef': 1, + 'name': 'Zone 10', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 11, + 'minRuntimeCoef': 1, + 'name': 'Zone 11', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 12, + 'minRuntimeCoef': 1, + 'name': 'Zone 12', + 'order': -1, + 'userPercentage': 1, + }), + ]), + 'yearlyRecurring': True, + }), + '2': dict({ + 'active': False, + 'coef': 0, + 'cs_on': False, + 'cycles': 0, + 'delay': 0, + 'delay_on': False, + 'endDate': None, + 'freq_modified': 0, + 'frequency': dict({ + 'param': '0', + 'type': 0, + }), + 'futureField1': 0, + 'ignoreInternetWeather': False, + 'name': 'Evening', + 'nextRun': '2018-06-04', + 'simulationExpired': False, + 'soak': 0, + 'startDate': '2018-04-28', + 'startTime': '06:00', + 'startTimeParams': dict({ + 'offsetMinutes': 0, + 'offsetSign': 0, + 'type': 0, + }), + 'status': 0, + 'uid': 2, + 'useWaterSense': False, + 'wateringTimes': list([ + dict({ + 'active': True, + 'duration': 0, + 'id': 1, + 'minRuntimeCoef': 1, + 'name': 'Landscaping', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': True, + 'duration': 0, + 'id': 2, + 'minRuntimeCoef': 1, + 'name': 'Flower Box', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 3, + 'minRuntimeCoef': 1, + 'name': 'TEST', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 4, + 'minRuntimeCoef': 1, + 'name': 'Zone 4', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 5, + 'minRuntimeCoef': 1, + 'name': 'Zone 5', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 6, + 'minRuntimeCoef': 1, + 'name': 'Zone 6', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 7, + 'minRuntimeCoef': 1, + 'name': 'Zone 7', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 8, + 'minRuntimeCoef': 1, + 'name': 'Zone 8', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 9, + 'minRuntimeCoef': 1, + 'name': 'Zone 9', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 10, + 'minRuntimeCoef': 1, + 'name': 'Zone 10', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 11, + 'minRuntimeCoef': 1, + 'name': 'Zone 11', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': False, + 'duration': 0, + 'id': 12, + 'minRuntimeCoef': 1, + 'name': 'Zone 12', + 'order': -1, + 'userPercentage': 1, + }), + ]), + 'yearlyRecurring': True, + }), + }), + 'provision.settings': dict({ + 'location': dict({ + 'address': 'Default', + 'doyDownloaded': True, + 'elevation': '**REDACTED**', + 'et0Average': 6.578, + 'krs': 0.16, + 'latitude': '**REDACTED**', + 'longitude': '**REDACTED**', + 'name': 'Home', + 'rainSensitivity': 0.8, + 'state': 'Default', + 'stationDownloaded': True, + 'stationID': '**REDACTED**', + 'stationName': '**REDACTED**', + 'stationSource': '**REDACTED**', + 'timezone': '**REDACTED**', + 'windSensitivity': 0.5, + 'wsDays': 2, + 'zip': None, + }), + 'system': dict({ + 'allowAlexaDiscovery': False, + 'automaticUpdates': True, + 'databasePath': '/rainmachine-app/DB/Default', + 'defaultZoneWateringDuration': 300, + 'hardwareVersion': 3, + 'httpEnabled': True, + 'localValveCount': 12, + 'masterValveAfter': 0, + 'masterValveBefore': 0, + 'maxLEDBrightness': 40, + 'maxWateringCoef': 2, + 'minLEDBrightness': 0, + 'minWateringDurationThreshold': 0, + 'mixerHistorySize': 365, + 'netName': 'Home', + 'parserDataSizeInDays': 6, + 'parserHistorySize': 365, + 'programListShowInactive': True, + 'programSingleSchedule': False, + 'programZonesShowInactive': False, + 'rainSensorIsNormallyClosed': True, + 'rainSensorRainStart': None, + 'rainSensorSnoozeDuration': 0, + 'runParsersBeforePrograms': True, + 'selfTest': False, + 'showRestrictionsOnLed': False, + 'simulatorHistorySize': 0, + 'softwareRainSensorMinQPF': 5, + 'standaloneMode': False, + 'touchAdvanced': False, + 'touchAuthAPSeconds': 60, + 'touchCyclePrograms': True, + 'touchLongPressTimeout': 3, + 'touchProgramToRun': None, + 'touchSleepTimeout': 10, + 'uiUnitsMetric': False, + 'useBonjourService': True, + 'useCommandLineArguments': False, + 'useCorrectionForPast': True, + 'useMasterValve': False, + 'useRainSensor': False, + 'useSoftwareRainSensor': False, + 'vibration': False, + 'waterLogHistorySize': 365, + 'wizardHasRun': True, + 'zoneDuration': list([ + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + 300, + ]), + 'zoneListShowInactive': True, + }), + }), + 'restrictions.current': dict({ + 'freeze': False, + 'hourly': False, + 'month': False, + 'rainDelay': False, + 'rainDelayCounter': -1, + 'rainSensor': False, + 'weekDay': False, + }), + 'restrictions.universal': dict({ + 'freezeProtectEnabled': True, + 'freezeProtectTemp': 2, + 'hotDaysExtraWatering': False, + 'noWaterInMonths': '000000000000', + 'noWaterInWeekDays': '0000000', + 'rainDelayDuration': 0, + 'rainDelayStartTime': 1524854551, + }), + 'zones': dict({ + '1': dict({ + 'ETcoef': 0.8, + 'active': True, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 4, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Landscaping', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 5, + 'state': 0, + 'sun': 1, + 'type': 4, + 'uid': 1, + 'userDuration': 0, + 'valveid': 1, + 'waterSense': dict({ + 'allowedSurfaceAcc': 8.38, + 'appEfficiency': 0.75, + 'area': 92.9000015258789, + 'currentFieldCapacity': 16.03, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.17, + 'flowrate': None, + 'isTallPlant': True, + 'maxAllowedDepletion': 0.5, + 'minRuntime': 0, + 'permWilting': 0.03, + 'precipitationRate': 25.4, + 'referenceTime': 1243, + 'rootDepth': 229, + 'soilIntakeRate': 10.16, + }), + }), + '10': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 10', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 10, + 'userDuration': 0, + 'valveid': 10, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '11': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 11', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 11, + 'userDuration': 0, + 'valveid': 11, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '12': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 12', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 12, + 'userDuration': 0, + 'valveid': 12, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '2': dict({ + 'ETcoef': 0.8, + 'active': True, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 3, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Flower Box', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 5, + 'state': 0, + 'sun': 1, + 'type': 5, + 'uid': 2, + 'userDuration': 0, + 'valveid': 2, + 'waterSense': dict({ + 'allowedSurfaceAcc': 8.38, + 'appEfficiency': 0.8, + 'area': 92.9, + 'currentFieldCapacity': 22.39, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.17, + 'flowrate': None, + 'isTallPlant': True, + 'maxAllowedDepletion': 0.35, + 'minRuntime': 5, + 'permWilting': 0.03, + 'precipitationRate': 12.7, + 'referenceTime': 2680, + 'rootDepth': 457, + 'soilIntakeRate': 10.16, + }), + }), + '3': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'TEST', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 9, + 'uid': 3, + 'userDuration': 0, + 'valveid': 3, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 113.4, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': None, + 'isTallPlant': True, + 'maxAllowedDepletion': 0.6, + 'minRuntime': 0, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 380, + 'rootDepth': 700, + 'soilIntakeRate': 5.08, + }), + }), + '4': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 4', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 4, + 'userDuration': 0, + 'valveid': 4, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '5': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 5', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 5, + 'userDuration': 0, + 'valveid': 5, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '6': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 6', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 6, + 'userDuration': 0, + 'valveid': 6, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '7': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 7', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 7, + 'userDuration': 0, + 'valveid': 7, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '8': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 8', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 8, + 'userDuration': 0, + 'valveid': 8, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + '9': dict({ + 'ETcoef': 0.8, + 'active': False, + 'after': 0, + 'before': 0, + 'customSoilPreset': None, + 'customSprinklerPreset': None, + 'customVegetationPreset': None, + 'cycle': 0, + 'group_id': 1, + 'history': True, + 'internet': True, + 'machineDuration': 0, + 'master': False, + 'name': 'Zone 9', + 'noOfCycles': 0, + 'remaining': 0, + 'restriction': False, + 'savings': 100, + 'slope': 1, + 'soil': 1, + 'state': 0, + 'sun': 1, + 'type': 2, + 'uid': 9, + 'userDuration': 0, + 'valveid': 9, + 'waterSense': dict({ + 'allowedSurfaceAcc': 6.6, + 'appEfficiency': 0.7, + 'area': 92.9, + 'currentFieldCapacity': 21.92, + 'detailedMonthsKc': list([ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + ]), + 'fieldCapacity': 0.3, + 'flowrate': 0.0, + 'isTallPlant': False, + 'maxAllowedDepletion': 0.4, + 'minRuntime': -1, + 'permWilting': 0.03, + 'precipitationRate': 35.56, + 'referenceTime': 761, + 'rootDepth': 203, + 'soilIntakeRate': 5.08, + }), + }), + }), + }), + }), + 'entry': dict({ + 'data': dict({ + 'ip_address': '192.168.1.100', + 'password': '**REDACTED**', + 'port': 8080, + 'ssl': True, + }), + 'disabled_by': None, + 'domain': 'rainmachine', + 'entry_id': '81bd010ed0a63b705f6da8407cb26d4b', + 'minor_version': 1, + 'options': dict({ + 'allow_inactive_zones_to_run': False, + 'use_app_run_times': False, + 'zone_run_time': 600, + }), + 'pref_disable_new_entities': False, + 'pref_disable_polling': False, + 'source': 'user', + 'title': 'Mock Title', + 'unique_id': '**REDACTED**', + 'version': 2, + }), + }) +# --- diff --git a/tests/components/rainmachine/test_diagnostics.py b/tests/components/rainmachine/test_diagnostics.py index 6ea50e5b102..1fc03ab357a 100644 --- a/tests/components/rainmachine/test_diagnostics.py +++ b/tests/components/rainmachine/test_diagnostics.py @@ -1,9 +1,8 @@ """Test RainMachine diagnostics.""" from regenmaschine.errors import RainMachineError +from syrupy import SnapshotAssertion -from homeassistant.components.diagnostics import REDACTED -from homeassistant.components.rainmachine.const import DEFAULT_ZONE_RUN from homeassistant.core import HomeAssistant from tests.components.diagnostics import get_diagnostics_for_config_entry @@ -15,628 +14,13 @@ async def test_entry_diagnostics( config_entry, hass_client: ClientSessionGenerator, setup_rainmachine, + snapshot: SnapshotAssertion, ) -> None: """Test config entry diagnostics.""" - assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == { - "entry": { - "entry_id": config_entry.entry_id, - "version": 2, - "minor_version": 1, - "domain": "rainmachine", - "title": "Mock Title", - "data": { - "ip_address": "192.168.1.100", - "password": REDACTED, - "port": 8080, - "ssl": True, - }, - "options": { - "zone_run_time": DEFAULT_ZONE_RUN, - "use_app_run_times": False, - "allow_inactive_zones_to_run": False, - }, - "pref_disable_new_entities": False, - "pref_disable_polling": False, - "source": "user", - "unique_id": REDACTED, - "disabled_by": None, - }, - "data": { - "coordinator": { - "api.versions": {"apiVer": "4.6.1", "hwVer": "3", "swVer": "4.0.1144"}, - "machine.firmware_update_status": { - "lastUpdateCheckTimestamp": 1657825288, - "packageDetails": [], - "update": False, - "lastUpdateCheck": "2022-07-14 13:01:28", - "updateStatus": 1, - }, - "programs": [ - { - "uid": 1, - "name": "Morning", - "active": True, - "startTime": "06:00", - "cycles": 0, - "soak": 0, - "cs_on": False, - "delay": 0, - "delay_on": False, - "status": 0, - "startTimeParams": { - "offsetSign": 0, - "type": 0, - "offsetMinutes": 0, - }, - "frequency": {"type": 0, "param": "0"}, - "coef": 0, - "ignoreInternetWeather": False, - "futureField1": 0, - "freq_modified": 0, - "useWaterSense": False, - "nextRun": "2018-06-04", - "startDate": "2018-04-28", - "endDate": None, - "yearlyRecurring": True, - "simulationExpired": False, - "wateringTimes": [ - { - "id": 1, - "order": -1, - "name": "Landscaping", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 2, - "order": -1, - "name": "Flower Box", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 3, - "order": -1, - "name": "TEST", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 4, - "order": -1, - "name": "Zone 4", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 5, - "order": -1, - "name": "Zone 5", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 6, - "order": -1, - "name": "Zone 6", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 7, - "order": -1, - "name": "Zone 7", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 8, - "order": -1, - "name": "Zone 8", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 9, - "order": -1, - "name": "Zone 9", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 10, - "order": -1, - "name": "Zone 10", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 11, - "order": -1, - "name": "Zone 11", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 12, - "order": -1, - "name": "Zone 12", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - ], - }, - { - "uid": 2, - "name": "Evening", - "active": False, - "startTime": "06:00", - "cycles": 0, - "soak": 0, - "cs_on": False, - "delay": 0, - "delay_on": False, - "status": 0, - "startTimeParams": { - "offsetSign": 0, - "type": 0, - "offsetMinutes": 0, - }, - "frequency": {"type": 0, "param": "0"}, - "coef": 0, - "ignoreInternetWeather": False, - "futureField1": 0, - "freq_modified": 0, - "useWaterSense": False, - "nextRun": "2018-06-04", - "startDate": "2018-04-28", - "endDate": None, - "yearlyRecurring": True, - "simulationExpired": False, - "wateringTimes": [ - { - "id": 1, - "order": -1, - "name": "Landscaping", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 2, - "order": -1, - "name": "Flower Box", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 3, - "order": -1, - "name": "TEST", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 4, - "order": -1, - "name": "Zone 4", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 5, - "order": -1, - "name": "Zone 5", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 6, - "order": -1, - "name": "Zone 6", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 7, - "order": -1, - "name": "Zone 7", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 8, - "order": -1, - "name": "Zone 8", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 9, - "order": -1, - "name": "Zone 9", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 10, - "order": -1, - "name": "Zone 10", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 11, - "order": -1, - "name": "Zone 11", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 12, - "order": -1, - "name": "Zone 12", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - ], - }, - ], - "provision.settings": { - "system": { - "httpEnabled": True, - "rainSensorSnoozeDuration": 0, - "uiUnitsMetric": False, - "programZonesShowInactive": False, - "programSingleSchedule": False, - "standaloneMode": False, - "masterValveAfter": 0, - "touchSleepTimeout": 10, - "selfTest": False, - "useSoftwareRainSensor": False, - "defaultZoneWateringDuration": 300, - "maxLEDBrightness": 40, - "simulatorHistorySize": 0, - "vibration": False, - "masterValveBefore": 0, - "touchProgramToRun": None, - "useRainSensor": False, - "wizardHasRun": True, - "waterLogHistorySize": 365, - "netName": "Home", - "softwareRainSensorMinQPF": 5, - "touchAdvanced": False, - "useBonjourService": True, - "hardwareVersion": 3, - "touchLongPressTimeout": 3, - "showRestrictionsOnLed": False, - "parserDataSizeInDays": 6, - "programListShowInactive": True, - "parserHistorySize": 365, - "allowAlexaDiscovery": False, - "automaticUpdates": True, - "minLEDBrightness": 0, - "minWateringDurationThreshold": 0, - "localValveCount": 12, - "touchAuthAPSeconds": 60, - "useCommandLineArguments": False, - "databasePath": "/rainmachine-app/DB/Default", - "touchCyclePrograms": True, - "zoneListShowInactive": True, - "rainSensorRainStart": None, - "zoneDuration": [ - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - ], - "rainSensorIsNormallyClosed": True, - "useCorrectionForPast": True, - "useMasterValve": False, - "runParsersBeforePrograms": True, - "maxWateringCoef": 2, - "mixerHistorySize": 365, - }, - "location": { - "elevation": REDACTED, - "doyDownloaded": True, - "zip": None, - "windSensitivity": 0.5, - "krs": 0.16, - "stationID": REDACTED, - "stationSource": REDACTED, - "et0Average": 6.578, - "latitude": REDACTED, - "state": "Default", - "stationName": REDACTED, - "wsDays": 2, - "stationDownloaded": True, - "address": "Default", - "rainSensitivity": 0.8, - "timezone": REDACTED, - "longitude": REDACTED, - "name": "Home", - }, - }, - "restrictions.current": { - "hourly": False, - "freeze": False, - "month": False, - "weekDay": False, - "rainDelay": False, - "rainDelayCounter": -1, - "rainSensor": False, - }, - "restrictions.universal": { - "hotDaysExtraWatering": False, - "freezeProtectEnabled": True, - "freezeProtectTemp": 2, - "noWaterInWeekDays": "0000000", - "noWaterInMonths": "000000000000", - "rainDelayStartTime": 1524854551, - "rainDelayDuration": 0, - }, - "zones": [ - { - "uid": 1, - "name": "Landscaping", - "state": 0, - "active": True, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 4, - "master": False, - "waterSense": False, - }, - { - "uid": 2, - "name": "Flower Box", - "state": 0, - "active": True, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 5, - "master": False, - "waterSense": False, - }, - { - "uid": 3, - "name": "TEST", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 9, - "master": False, - "waterSense": False, - }, - { - "uid": 4, - "name": "Zone 4", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 5, - "name": "Zone 5", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 6, - "name": "Zone 6", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 7, - "name": "Zone 7", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 8, - "name": "Zone 8", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 9, - "name": "Zone 9", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 10, - "name": "Zone 10", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 11, - "name": "Zone 11", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 12, - "name": "Zone 12", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - ], - }, - "controller_diagnostics": { - "hasWifi": True, - "uptime": "3 days, 18:14:14", - "uptimeSeconds": 324854, - "memUsage": 16196, - "networkStatus": True, - "bootCompleted": True, - "lastCheckTimestamp": 1659895175, - "wizardHasRun": True, - "standaloneMode": False, - "cpuUsage": 1, - "lastCheck": "2022-08-07 11:59:35", - "softwareVersion": "4.0.1144", - "internetStatus": True, - "locationStatus": True, - "timeStatus": True, - "wifiMode": None, - "gatewayAddress": "172.16.20.1", - "cloudStatus": 0, - "weatherStatus": True, - }, - }, - } + assert ( + await get_diagnostics_for_config_entry(hass, hass_client, config_entry) + == snapshot + ) async def test_entry_diagnostics_failed_controller_diagnostics( @@ -645,606 +29,11 @@ async def test_entry_diagnostics_failed_controller_diagnostics( controller, hass_client: ClientSessionGenerator, setup_rainmachine, + snapshot: SnapshotAssertion, ) -> None: """Test config entry diagnostics when the controller diagnostics API call fails.""" controller.diagnostics.current.side_effect = RainMachineError - assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == { - "entry": { - "entry_id": config_entry.entry_id, - "version": 2, - "minor_version": 1, - "domain": "rainmachine", - "title": "Mock Title", - "data": { - "ip_address": "192.168.1.100", - "password": REDACTED, - "port": 8080, - "ssl": True, - }, - "options": { - "zone_run_time": DEFAULT_ZONE_RUN, - "use_app_run_times": False, - "allow_inactive_zones_to_run": False, - }, - "pref_disable_new_entities": False, - "pref_disable_polling": False, - "source": "user", - "unique_id": REDACTED, - "disabled_by": None, - }, - "data": { - "coordinator": { - "api.versions": {"apiVer": "4.6.1", "hwVer": "3", "swVer": "4.0.1144"}, - "machine.firmware_update_status": { - "lastUpdateCheckTimestamp": 1657825288, - "packageDetails": [], - "update": False, - "lastUpdateCheck": "2022-07-14 13:01:28", - "updateStatus": 1, - }, - "programs": [ - { - "uid": 1, - "name": "Morning", - "active": True, - "startTime": "06:00", - "cycles": 0, - "soak": 0, - "cs_on": False, - "delay": 0, - "delay_on": False, - "status": 0, - "startTimeParams": { - "offsetSign": 0, - "type": 0, - "offsetMinutes": 0, - }, - "frequency": {"type": 0, "param": "0"}, - "coef": 0, - "ignoreInternetWeather": False, - "futureField1": 0, - "freq_modified": 0, - "useWaterSense": False, - "nextRun": "2018-06-04", - "startDate": "2018-04-28", - "endDate": None, - "yearlyRecurring": True, - "simulationExpired": False, - "wateringTimes": [ - { - "id": 1, - "order": -1, - "name": "Landscaping", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 2, - "order": -1, - "name": "Flower Box", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 3, - "order": -1, - "name": "TEST", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 4, - "order": -1, - "name": "Zone 4", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 5, - "order": -1, - "name": "Zone 5", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 6, - "order": -1, - "name": "Zone 6", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 7, - "order": -1, - "name": "Zone 7", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 8, - "order": -1, - "name": "Zone 8", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 9, - "order": -1, - "name": "Zone 9", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 10, - "order": -1, - "name": "Zone 10", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 11, - "order": -1, - "name": "Zone 11", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 12, - "order": -1, - "name": "Zone 12", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - ], - }, - { - "uid": 2, - "name": "Evening", - "active": False, - "startTime": "06:00", - "cycles": 0, - "soak": 0, - "cs_on": False, - "delay": 0, - "delay_on": False, - "status": 0, - "startTimeParams": { - "offsetSign": 0, - "type": 0, - "offsetMinutes": 0, - }, - "frequency": {"type": 0, "param": "0"}, - "coef": 0, - "ignoreInternetWeather": False, - "futureField1": 0, - "freq_modified": 0, - "useWaterSense": False, - "nextRun": "2018-06-04", - "startDate": "2018-04-28", - "endDate": None, - "yearlyRecurring": True, - "simulationExpired": False, - "wateringTimes": [ - { - "id": 1, - "order": -1, - "name": "Landscaping", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 2, - "order": -1, - "name": "Flower Box", - "duration": 0, - "active": True, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 3, - "order": -1, - "name": "TEST", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 4, - "order": -1, - "name": "Zone 4", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 5, - "order": -1, - "name": "Zone 5", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 6, - "order": -1, - "name": "Zone 6", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 7, - "order": -1, - "name": "Zone 7", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 8, - "order": -1, - "name": "Zone 8", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 9, - "order": -1, - "name": "Zone 9", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 10, - "order": -1, - "name": "Zone 10", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 11, - "order": -1, - "name": "Zone 11", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - { - "id": 12, - "order": -1, - "name": "Zone 12", - "duration": 0, - "active": False, - "userPercentage": 1, - "minRuntimeCoef": 1, - }, - ], - }, - ], - "provision.settings": { - "system": { - "httpEnabled": True, - "rainSensorSnoozeDuration": 0, - "uiUnitsMetric": False, - "programZonesShowInactive": False, - "programSingleSchedule": False, - "standaloneMode": False, - "masterValveAfter": 0, - "touchSleepTimeout": 10, - "selfTest": False, - "useSoftwareRainSensor": False, - "defaultZoneWateringDuration": 300, - "maxLEDBrightness": 40, - "simulatorHistorySize": 0, - "vibration": False, - "masterValveBefore": 0, - "touchProgramToRun": None, - "useRainSensor": False, - "wizardHasRun": True, - "waterLogHistorySize": 365, - "netName": "Home", - "softwareRainSensorMinQPF": 5, - "touchAdvanced": False, - "useBonjourService": True, - "hardwareVersion": 3, - "touchLongPressTimeout": 3, - "showRestrictionsOnLed": False, - "parserDataSizeInDays": 6, - "programListShowInactive": True, - "parserHistorySize": 365, - "allowAlexaDiscovery": False, - "automaticUpdates": True, - "minLEDBrightness": 0, - "minWateringDurationThreshold": 0, - "localValveCount": 12, - "touchAuthAPSeconds": 60, - "useCommandLineArguments": False, - "databasePath": "/rainmachine-app/DB/Default", - "touchCyclePrograms": True, - "zoneListShowInactive": True, - "rainSensorRainStart": None, - "zoneDuration": [ - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - 300, - ], - "rainSensorIsNormallyClosed": True, - "useCorrectionForPast": True, - "useMasterValve": False, - "runParsersBeforePrograms": True, - "maxWateringCoef": 2, - "mixerHistorySize": 365, - }, - "location": { - "elevation": REDACTED, - "doyDownloaded": True, - "zip": None, - "windSensitivity": 0.5, - "krs": 0.16, - "stationID": REDACTED, - "stationSource": REDACTED, - "et0Average": 6.578, - "latitude": REDACTED, - "state": "Default", - "stationName": REDACTED, - "wsDays": 2, - "stationDownloaded": True, - "address": "Default", - "rainSensitivity": 0.8, - "timezone": REDACTED, - "longitude": REDACTED, - "name": "Home", - }, - }, - "restrictions.current": { - "hourly": False, - "freeze": False, - "month": False, - "weekDay": False, - "rainDelay": False, - "rainDelayCounter": -1, - "rainSensor": False, - }, - "restrictions.universal": { - "hotDaysExtraWatering": False, - "freezeProtectEnabled": True, - "freezeProtectTemp": 2, - "noWaterInWeekDays": "0000000", - "noWaterInMonths": "000000000000", - "rainDelayStartTime": 1524854551, - "rainDelayDuration": 0, - }, - "zones": [ - { - "uid": 1, - "name": "Landscaping", - "state": 0, - "active": True, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 4, - "master": False, - "waterSense": False, - }, - { - "uid": 2, - "name": "Flower Box", - "state": 0, - "active": True, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 5, - "master": False, - "waterSense": False, - }, - { - "uid": 3, - "name": "TEST", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 9, - "master": False, - "waterSense": False, - }, - { - "uid": 4, - "name": "Zone 4", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 5, - "name": "Zone 5", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 6, - "name": "Zone 6", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 7, - "name": "Zone 7", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 8, - "name": "Zone 8", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 9, - "name": "Zone 9", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 10, - "name": "Zone 10", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 11, - "name": "Zone 11", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - { - "uid": 12, - "name": "Zone 12", - "state": 0, - "active": False, - "userDuration": 0, - "machineDuration": 0, - "remaining": 0, - "cycle": 0, - "noOfCycles": 0, - "restriction": False, - "type": 2, - "master": False, - "waterSense": False, - }, - ], - }, - "controller_diagnostics": None, - }, - } + assert ( + await get_diagnostics_for_config_entry(hass, hass_client, config_entry) + == snapshot + )