diff --git a/tests/components/myuplink/conftest.py b/tests/components/myuplink/conftest.py index c1937a8ce3c..e6380b101cb 100644 --- a/tests/components/myuplink/conftest.py +++ b/tests/components/myuplink/conftest.py @@ -93,7 +93,7 @@ def load_systems_jv_file(load_systems_file: str) -> dict[str, Any]: @pytest.fixture(scope="session") def load_systems_file() -> str: """Load fixture file for systems.""" - return load_fixture("systems.json", DOMAIN) + return load_fixture("systems-2dev.json", DOMAIN) @pytest.fixture diff --git a/tests/components/myuplink/fixtures/device-2dev.json b/tests/components/myuplink/fixtures/device-2dev.json new file mode 100644 index 00000000000..96360f87ce7 --- /dev/null +++ b/tests/components/myuplink/fixtures/device-2dev.json @@ -0,0 +1,40 @@ +{ + "id": "robin-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff", + "connectionState": "Connected", + "firmware": { + "currentFwVersion": "9682R7", + "desiredFwVersion": "9682R7" + }, + "product": { + "serialNumber": "222222", + "name": "F730 CU 3x400V" + }, + "availableFeatures": { + "settings": true, + "reboot": true, + "forcesync": true, + "forceUpdate": false, + "requestUpdate": false, + "resetAlarm": true, + "triggerEvent": true, + "getMenu": false, + "getMenuChain": false, + "getGuideQuestion": false, + "sendHaystack": true, + "setSmartMode": false, + "setAidMode": true, + "getZones": false, + "processIntent": false, + "boostHotWater": true, + "boostVentilation": true, + "getScheduleConfig": false, + "getScheduleModes": false, + "getScheduleWeekly": false, + "getScheduleVacation": false, + "setScheduleModes": false, + "setScheduleWeekly": false, + "setScheduleOverride": false, + "setScheduleVacation": false, + "setVentilationMode": false + } +} diff --git a/tests/components/myuplink/fixtures/systems-2dev.json b/tests/components/myuplink/fixtures/systems-2dev.json new file mode 100644 index 00000000000..0718fc2301d --- /dev/null +++ b/tests/components/myuplink/fixtures/systems-2dev.json @@ -0,0 +1,34 @@ +{ + "page": 1, + "itemsPerPage": 10, + "numItems": 1, + "systems": [ + { + "systemId": "123456-7890-1234", + "name": "Gotham City", + "securityLevel": "admin", + "hasAlarm": false, + "country": "Sweden", + "devices": [ + { + "id": "robin-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff", + "connectionState": "Connected", + "currentFwVersion": "9682R7", + "product": { + "serialNumber": "222222", + "name": "F730 CU 3x400V" + } + }, + { + "id": "batman-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff", + "connectionState": "Connected", + "currentFwVersion": "9682R7", + "product": { + "serialNumber": "123456", + "name": "F730 CU 3x400V" + } + } + ] + } + ] +} diff --git a/tests/components/myuplink/snapshots/test_diagnostics.ambr b/tests/components/myuplink/snapshots/test_diagnostics.ambr index 49bdfeba93e..53664820364 100644 --- a/tests/components/myuplink/snapshots/test_diagnostics.ambr +++ b/tests/components/myuplink/snapshots/test_diagnostics.ambr @@ -1018,6 +1018,1011 @@ ''', }), }), + dict({ + '123456-7890-1234': dict({ + 'device_data': ''' + { + "id": "batman-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff", + "connectionState": "Connected", + "firmware": { + "currentFwVersion": "9682R7", + "desiredFwVersion": "9682R7" + }, + "product": { + "serialNumber": "123456", + "name": "F730 CU 3x400V" + }, + "availableFeatures": { + "settings": true, + "reboot": true, + "forcesync": true, + "forceUpdate": false, + "requestUpdate": false, + "resetAlarm": true, + "triggerEvent": true, + "getMenu": false, + "getMenuChain": false, + "getGuideQuestion": false, + "sendHaystack": true, + "setSmartMode": false, + "setAidMode": true, + "getZones": false, + "processIntent": false, + "boostHotWater": true, + "boostVentilation": true, + "getScheduleConfig": false, + "getScheduleModes": false, + "getScheduleWeekly": false, + "getScheduleVacation": false, + "setScheduleModes": false, + "setScheduleWeekly": false, + "setScheduleOverride": false, + "setScheduleVacation": false, + "setVentilationMode": false + } + } + + ''', + 'points': ''' + [ + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40004", + "parameterName": "Current outd temp (BT1)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:56:12+00:00", + "value": -9.3, + "strVal": "-9.3°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40008", + "parameterName": "Supply line (BT2)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:58:51+00:00", + "value": 39.7, + "strVal": "39.7°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40012", + "parameterName": "Return line (BT3)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:08:40+00:00", + "value": 34.4, + "strVal": "34.4°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40013", + "parameterName": "Hot water top (BT7)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T08:39:32+00:00", + "value": 46, + "strVal": "46°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40014", + "parameterName": "Hot water char­ging (BT6)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:58:42+00:00", + "value": 44.4, + "strVal": "44.4°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40017", + "parameterName": "Con­denser (BT12)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:41:49+00:00", + "value": 37.7, + "strVal": "37.7°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40018", + "parameterName": "Dis­charge (BT14)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:19:24+00:00", + "value": 89.1, + "strVal": "89.1°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40019", + "parameterName": "Liquid line (BT15)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:42:11+00:00", + "value": 34.4, + "strVal": "34.4°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40020", + "parameterName": "Evap­orator (BT16)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T11:11:00+00:00", + "value": -14.7, + "strVal": "-14.7°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40022", + "parameterName": "Suction gas (BT17)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T11:11:28+00:00", + "value": -1.1, + "strVal": "-1.1°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40025", + "parameterName": "Exhaust air (BT20)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T09:48:50+00:00", + "value": 22.5, + "strVal": "22.5°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40026", + "parameterName": "Extract air (BT21)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T11:11:15+00:00", + "value": -12.1, + "strVal": "-12.1°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40033", + "parameterName": "Room temp­erature (BT50)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T00:21:48+00:00", + "value": 21.2, + "strVal": "21.2°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40047", + "parameterName": "Supply line (BT61)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": -32768, + "strVal": "-32768°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40048", + "parameterName": "Return line (BT62)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": -32768, + "strVal": "-32768°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40050", + "parameterName": "Value, air veloc­ity sensor (BS1)", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-09T11:10:42+00:00", + "value": 101.5, + "strVal": "101.5", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40067", + "parameterName": "Average outdoor temp (BT1)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:56:45+00:00", + "value": -12.2, + "strVal": "-12.2°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40079", + "parameterName": "Current (BE1)", + "parameterUnit": "A", + "writable": false, + "timestamp": "2024-02-09T09:05:50+00:00", + "value": 3.1, + "strVal": "3.1A", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40081", + "parameterName": "Current (BE2)", + "parameterUnit": "A", + "writable": false, + "timestamp": "2024-02-09T11:11:19+00:00", + "value": 0.3, + "strVal": "0.3A", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40083", + "parameterName": "Current (BE3)", + "parameterUnit": "A", + "writable": false, + "timestamp": "2024-02-09T09:46:11+00:00", + "value": 5.7, + "strVal": "5.7A", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40145", + "parameterName": "Oil temp­erature (EP15-BT29)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 0, + "strVal": "0°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40146", + "parameterName": "Oil temp­erature (BT29)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 0, + "strVal": "0°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40940", + "parameterName": "Degree minutes", + "parameterUnit": "", + "writable": true, + "timestamp": "2024-02-09T11:09:39+00:00", + "value": -875, + "strVal": "-875", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "40940", + "parameterName": "Degree minutes", + "parameterUnit": "", + "writable": true, + "timestamp": "2024-02-09T11:09:39+00:00", + "value": -875, + "strVal": "-875", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "41778", + "parameterName": "Current com­pressor fre­quency", + "parameterUnit": "Hz", + "writable": false, + "timestamp": "2024-02-09T10:07:47+00:00", + "value": 57, + "strVal": "57Hz", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "42770", + "parameterName": "Desired humid­ity", + "parameterUnit": "%", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 0, + "strVal": "0%", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43009", + "parameterName": "Calcu­lated supply climate system 1", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T11:04:53+00:00", + "value": 37.9, + "strVal": "37.9°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43066", + "parameterName": "Defrost­ing time", + "parameterUnit": "s", + "writable": false, + "timestamp": "2024-02-09T09:45:41+00:00", + "value": 0, + "strVal": "0s", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43081", + "parameterName": "Time factor add heat", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-09T10:59:11+00:00", + "value": 1686.9, + "strVal": "1686.9", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43108", + "parameterName": "Current fan mode", + "parameterUnit": "%", + "writable": false, + "timestamp": "2024-02-08T16:27:27+00:00", + "value": 0, + "strVal": "0%", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43109", + "parameterName": "Current hot water mode", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-06T21:14:34+00:00", + "value": 0, + "strVal": "0", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43115", + "parameterName": "Hot water: charge set point value", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 0, + "strVal": "0°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43116", + "parameterName": "Hot water: charge current value ((BT12 | BT63))", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 0, + "strVal": "0°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43122", + "parameterName": "Min com­pressor fre­quency", + "parameterUnit": "Hz", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 20, + "strVal": "20Hz", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43123", + "parameterName": "Max com­pressor fre­quency", + "parameterUnit": "Hz", + "writable": false, + "timestamp": "2024-02-09T10:07:44+00:00", + "value": 57, + "strVal": "57Hz", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43124", + "parameterName": "Refer­ence, air speed sensor", + "parameterUnit": "m3/h", + "writable": false, + "timestamp": "2024-02-09T09:51:03+00:00", + "value": 127.6, + "strVal": "127.6m3/h", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43125", + "parameterName": "De­crease from refer­ence value", + "parameterUnit": "%", + "writable": false, + "timestamp": "2024-02-09T11:08:28+00:00", + "value": -1.1, + "strVal": "-1.1%", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43140", + "parameterName": "Invert­er temp­erature", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:19:11+00:00", + "value": 37.2, + "strVal": "37.2°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43146", + "parameterName": "dT Invert­er - exh air (BT20)", + "parameterUnit": "°C", + "writable": false, + "timestamp": "2024-02-09T10:37:53+00:00", + "value": 14.9, + "strVal": "14.9°C", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "0.1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43161", + "parameterName": "Extern. adjust­ment climate system 1", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 0, + "strVal": "Off", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "0", + "text": "Off", + "icon": "" + }, + { + "value": "1", + "text": "On", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43427", + "parameterName": "Status com­pressor", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-09T09:46:01+00:00", + "value": 60, + "strVal": "runs", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "20", + "text": "off", + "icon": "" + }, + { + "value": "40", + "text": "starts", + "icon": "" + }, + { + "value": "60", + "text": "runs", + "icon": "" + }, + { + "value": "100", + "text": "stops", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "43437", + "parameterName": "Heating medium pump speed (GP1)", + "parameterUnit": "%", + "writable": false, + "timestamp": "2024-02-09T10:34:44+00:00", + "value": 79, + "strVal": "79%", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "49633", + "parameterName": "Desired humid­ity", + "parameterUnit": "%", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 50, + "strVal": "50%", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "49993", + "parameterName": "Int elec add heat", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-08T18:57:28+00:00", + "value": 6, + "strVal": "Active", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "0", + "text": "Alarm", + "icon": "" + }, + { + "value": "1", + "text": "Alarm", + "icon": "" + }, + { + "value": "2", + "text": "Active", + "icon": "" + }, + { + "value": "3", + "text": "Off", + "icon": "" + }, + { + "value": "4", + "text": "Blocked", + "icon": "" + }, + { + "value": "5", + "text": "Off", + "icon": "" + }, + { + "value": "6", + "text": "Active", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "49994", + "parameterName": "Prior­ity", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-08T19:13:05+00:00", + "value": 30, + "strVal": "Heating", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "10", + "text": "Off", + "icon": "" + }, + { + "value": "20", + "text": "Hot water", + "icon": "" + }, + { + "value": "30", + "text": "Heating", + "icon": "" + }, + { + "value": "40", + "text": "Pool", + "icon": "" + }, + { + "value": "41", + "text": "Pool 2", + "icon": "" + }, + { + "value": "50", + "text": "Trans­fer", + "icon": "" + }, + { + "value": "60", + "text": "Cooling", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "49995", + "parameterName": "Pump: Heating medium (GP1)", + "parameterUnit": "", + "writable": false, + "timestamp": "2024-02-01T14:30:32+00:00", + "value": 1, + "strVal": "On", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "0", + "text": "Off", + "icon": "" + }, + { + "value": "1", + "text": "On", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "50004", + "parameterName": "Tempo­rary lux", + "parameterUnit": "", + "writable": true, + "timestamp": "2024-02-04T21:06:26+00:00", + "value": 0, + "strVal": "off", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "0", + "text": "off", + "icon": "" + }, + { + "value": "1", + "text": "on", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + }, + { + "category": "NIBEF F730 CU 3x400V", + "parameterId": "50005", + "parameterName": "In­creased venti­lation", + "parameterUnit": "", + "writable": true, + "timestamp": "2024-02-08T16:27:26+00:00", + "value": 0, + "strVal": "off", + "smartHomeCategories": [], + "minValue": null, + "maxValue": null, + "stepValue": 1, + "enumValues": [ + { + "value": "0", + "text": "off", + "icon": "" + }, + { + "value": "1", + "text": "on", + "icon": "" + } + ], + "scaleValue": "1", + "zoneId": null + } + ] + + ''', + }), + }), ]), 'itemsPerPage': 10, 'numItems': 1, @@ -1026,6 +2031,15 @@ dict({ 'country': 'Sweden', 'devices': list([ + dict({ + 'connectionState': 'Connected', + 'currentFwVersion': '9682R7', + 'id': 'robin-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff', + 'product': dict({ + 'name': 'F730 CU 3x400V', + 'serialNumber': '**REDACTED**', + }), + }), dict({ 'connectionState': 'Connected', 'currentFwVersion': '9682R7', diff --git a/tests/components/myuplink/test_init.py b/tests/components/myuplink/test_init.py index 728bcbc702f..17b899aa662 100644 --- a/tests/components/myuplink/test_init.py +++ b/tests/components/myuplink/test_init.py @@ -8,10 +8,11 @@ import pytest from homeassistant.components.myuplink.const import DOMAIN, OAUTH2_TOKEN from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant +from homeassistant.helpers import device_registry as dr from . import setup_integration -from tests.common import MockConfigEntry +from tests.common import MockConfigEntry, load_fixture from tests.test_util.aiohttp import AiohttpClientMocker @@ -66,3 +67,33 @@ async def test_expired_token_refresh_failure( await setup_integration(hass, mock_config_entry) assert mock_config_entry.state is expected_state + + +@pytest.mark.parametrize( + "load_systems_file", + [load_fixture("systems.json", DOMAIN)], +) +async def test_devices_created_count( + hass: HomeAssistant, + mock_myuplink_client: MagicMock, + mock_config_entry: MockConfigEntry, +) -> None: + """Test that one device is created.""" + await setup_integration(hass, mock_config_entry) + + device_registry = dr.async_get(hass) + + assert len(device_registry.devices) == 1 + + +async def test_devices_multiple_created_count( + hass: HomeAssistant, + mock_myuplink_client: MagicMock, + mock_config_entry: MockConfigEntry, +) -> None: + """Test that multiple device are created.""" + await setup_integration(hass, mock_config_entry) + + device_registry = dr.async_get(hass) + + assert len(device_registry.devices) == 2 diff --git a/tests/components/myuplink/test_number.py b/tests/components/myuplink/test_number.py index 158ef35dc77..09f361f0ec6 100644 --- a/tests/components/myuplink/test_number.py +++ b/tests/components/myuplink/test_number.py @@ -16,7 +16,7 @@ pytestmark = pytest.mark.parametrize("platforms", [(TEST_PLATFORM,)]) ENTITY_ID = "number.f730_cu_3x400v_degree_minutes" ENTITY_FRIENDLY_NAME = "F730 CU 3x400V Degree minutes" -ENTITY_UID = "batman-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff-40940" +ENTITY_UID = "robin-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff-40940" async def test_entity_registry( diff --git a/tests/components/myuplink/test_switch.py b/tests/components/myuplink/test_switch.py index cbc60cbfc0a..06855fd91da 100644 --- a/tests/components/myuplink/test_switch.py +++ b/tests/components/myuplink/test_switch.py @@ -21,7 +21,7 @@ pytestmark = pytest.mark.parametrize("platforms", [(TEST_PLATFORM,)]) ENTITY_ID = "switch.f730_cu_3x400v_temporary_lux" ENTITY_FRIENDLY_NAME = "F730 CU 3x400V Tempo­rary lux" -ENTITY_UID = "batman-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff-50004" +ENTITY_UID = "robin-r-1234-20240201-123456-aa-bb-cc-dd-ee-ff-50004" async def test_entity_registry(