diff --git a/CHANGELOG.md b/CHANGELOG.md index b582165fa..25d4603be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.37.0 + +- Refactor code into separate parts/paths for actual and legacy Plugwise devices. + ## v0.36.3 - Bugfixes for [#558](https://github.com/plugwise/plugwise-beta/issues/558) and [#559](https://github.com/plugwise/plugwise-beta/issues/559). diff --git a/fixtures/adam_heatpump_cooling/all_data.json b/fixtures/adam_heatpump_cooling/all_data.json index 7f1685894..4653f324c 100644 --- a/fixtures/adam_heatpump_cooling/all_data.json +++ b/fixtures/adam_heatpump_cooling/all_data.json @@ -4,7 +4,7 @@ "available": true, "binary_sensors": { "cooling_state": false, - "dhw_state": false, + "dhw_state": true, "flame_state": false, "heating_state": false }, diff --git a/fixtures/adam_heatpump_cooling/device_list.json b/fixtures/adam_heatpump_cooling/device_list.json deleted file mode 100644 index a712cb97f..000000000 --- a/fixtures/adam_heatpump_cooling/device_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "7d97fc3117784cfdafe347bcedcbbbcb", - "0ca13e8176204ca7bf6f09de59f81c83", - "1053c8bbf8be43c6921742b146a625f1", - "a03b6e8e76dd4646af1a77c31dd9370c", - "bbcffa48019f4b09b8368bbaf9559e68", - "f04c985c11ad4848b8fcd710343f9dcf", - "2e0fc4db2a6d4cbeb7cf786143543961", - "3f0afa71f16c45ab964050002560e43c", - "ca79d23ae0094120b877558734cff85c", - "838c2f48195242709b87217cf8d8a71f", - "c4ed311d54e341f58b4cdd201d1fde7e", - "eac5db95d97241f6b17790897847ccf5", - "beb32da072274e698146db8b022f3c36", - "96714ad90fc948bcbcb5021c4b9f5ae9", - "3b4d2574e2c9443a832b48d19a1c4f06", - "5ead63c65e5f44e7870ba2bd680ceb9e", - "1a27dd03b5454c4e8b9e75c8d1afc7af", - "8a482fa9dddb43acb765d019d8c9838b", - "ea8372c0e3ad4622ad45a041d02425f5", - "d3a276aeb3114a509bab1e4bf8c40348", - "47e2c550a33846b680725aa3fb229473", - "7fda9f84f01342f8afe9ebbbbff30c0f" -] diff --git a/fixtures/adam_heatpump_cooling/notifications.json b/fixtures/adam_heatpump_cooling/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/adam_heatpump_cooling/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/adam_jip/all_data.json b/fixtures/adam_jip/all_data.json index a5f5124cd..3f0c48d89 100644 --- a/fixtures/adam_jip/all_data.json +++ b/fixtures/adam_jip/all_data.json @@ -67,7 +67,7 @@ "name": "Tom Slaapkamer", "sensors": { "setpoint": 13.0, - "temperature": 24.3, + "temperature": 24.2, "temperature_difference": 1.7, "valve_position": 0.0 }, diff --git a/fixtures/adam_jip/device_list.json b/fixtures/adam_jip/device_list.json deleted file mode 100644 index 049845bc8..000000000 --- a/fixtures/adam_jip/device_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "b5c2386c6f6342669e50fe49dd05b188", - "e4684553153b44afbef2200885f379dc", - "a6abc6a129ee499c88a4d420cc413b47", - "1346fbd8498d4dbcab7e18d51b771f3d", - "833de10f269c4deab58fb9df69901b4e", - "6f3e9d7084214c21b9dfa46f6eeb8700", - "f61f1a2535f54f52ad006a3d18e459ca", - "d4496250d0e942cfa7aea3476e9070d5", - "356b65335e274d769c338223e7af9c33", - "1da4d325838e4ad8aac12177214505c9", - "457ce8414de24596a2d5e7dbc9c7682f" -] diff --git a/fixtures/adam_jip/notifications.json b/fixtures/adam_jip/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/adam_jip/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/adam_multiple_devices_per_zone/all_data.json b/fixtures/adam_multiple_devices_per_zone/all_data.json index f97182782..47c8e4dce 100644 --- a/fixtures/adam_multiple_devices_per_zone/all_data.json +++ b/fixtures/adam_multiple_devices_per_zone/all_data.json @@ -28,7 +28,7 @@ "model": "Plug", "name": "Playstation Smart Plug", "sensors": { - "electricity_consumed": 82.6, + "electricity_consumed": 84.1, "electricity_consumed_interval": 8.6, "electricity_produced": 0.0, "electricity_produced_interval": 0.0 diff --git a/fixtures/adam_multiple_devices_per_zone/device_list.json b/fixtures/adam_multiple_devices_per_zone/device_list.json deleted file mode 100644 index 104a723e4..000000000 --- a/fixtures/adam_multiple_devices_per_zone/device_list.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - "fe799307f1624099878210aa0b9f1475", - "90986d591dcd426cae3ec3e8111ff730", - "df4a4a8169904cdb9c03d61a21f42140", - "b310b72a0e354bfab43089919b9a88bf", - "a2c3583e0a6349358998b760cea82d2a", - "b59bcebaf94b499ea7d46e4a66fb62d8", - "d3da73bde12a47d5a6b8f9dad971f2ec", - "21f2b542c49845e6bb416884c55778d6", - "78d1126fc4c743db81b61c20e88342a7", - "cd0ddb54ef694e11ac18ed1cbce5dbbd", - "4a810418d5394b3f82727340b91ba740", - "02cf28bfec924855854c544690a609ef", - "a28f588dc4a049a483fd03a30361ad3a", - "6a3bf693d05e48e0b460c815a4fdd09d", - "680423ff840043738f42cc7f1ff97a36", - "f1fee6043d3642a9b0a65297455f008e", - "675416a629f343c495449970e2ca37b5", - "e7693eb9582644e5b865dba8d4447cf1" -] diff --git a/fixtures/adam_multiple_devices_per_zone/notifications.json b/fixtures/adam_multiple_devices_per_zone/notifications.json deleted file mode 100644 index 8749be4c3..000000000 --- a/fixtures/adam_multiple_devices_per_zone/notifications.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "af82e4ccf9c548528166d38e560662a4": { - "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." - } -} diff --git a/fixtures/adam_onoff_cooling_fake_firmware/all_data.json b/fixtures/adam_onoff_cooling_fake_firmware/all_data.json index fc2ff2703..18567e57a 100644 --- a/fixtures/adam_onoff_cooling_fake_firmware/all_data.json +++ b/fixtures/adam_onoff_cooling_fake_firmware/all_data.json @@ -3,7 +3,7 @@ "0ca13e8176204ca7bf6f09de59f81c83": { "binary_sensors": { "cooling_state": true, - "dhw_state": false, + "dhw_state": true, "flame_state": false, "heating_state": false }, @@ -25,7 +25,7 @@ "name": "OnOff", "sensors": { "dhw_temperature": 63.5, - "intended_boiler_temperature": 35.0, + "intended_boiler_temperature": 0.0, "modulation_level": 0.0, "outdoor_air_temperature": 13.5, "return_temperature": 24.9, diff --git a/fixtures/adam_onoff_cooling_fake_firmware/device_list.json b/fixtures/adam_onoff_cooling_fake_firmware/device_list.json deleted file mode 100644 index 212c542d6..000000000 --- a/fixtures/adam_onoff_cooling_fake_firmware/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "7d97fc3117784cfdafe347bcedcbbbcb", - "0ca13e8176204ca7bf6f09de59f81c83", - "ca79d23ae0094120b877558734cff85c" -] diff --git a/fixtures/adam_onoff_cooling_fake_firmware/notifications.json b/fixtures/adam_onoff_cooling_fake_firmware/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/adam_onoff_cooling_fake_firmware/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/adam_plus_anna/all_data.json b/fixtures/adam_plus_anna/all_data.json index b43d3c6e7..ba5f0dc42 100644 --- a/fixtures/adam_plus_anna/all_data.json +++ b/fixtures/adam_plus_anna/all_data.json @@ -19,7 +19,7 @@ "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, - "water_temperature": 47.0 + "water_temperature": 48.0 }, "switches": { "dhw_cm_switch": false @@ -92,7 +92,7 @@ "location": "5ccb6c41a7d9403988d261ceee04239f", "name": "Work-PC", "sensors": { - "electricity_consumed": 79.8, + "electricity_consumed": 80.5, "electricity_consumed_interval": 7.03, "electricity_produced": 0.0, "electricity_produced_interval": 0.0 diff --git a/fixtures/adam_plus_anna/device_list.json b/fixtures/adam_plus_anna/device_list.json deleted file mode 100644 index b9291e763..000000000 --- a/fixtures/adam_plus_anna/device_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "b128b4bbbd1f47e9bf4d756e8fb5ee94", - "2743216f626f43948deec1f7ab3b3d70", - "aa6b0002df0a46e1b1eb94beb61eddfe", - "ee62cad889f94e8ca3d09021f03a660b", - "f2be121e4a9345ac83c6e99ed89a98be" -] diff --git a/fixtures/adam_plus_anna/notifications.json b/fixtures/adam_plus_anna/notifications.json deleted file mode 100644 index c51fa8cb3..000000000 --- a/fixtures/adam_plus_anna/notifications.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "6fb89e35caeb4b1cb275184895202d84": { - "error": "There is no OpenTherm communication with the boiler." - } -} diff --git a/fixtures/adam_plus_anna_copy_with_error_domain_added/device_list.json b/fixtures/adam_plus_anna_copy_with_error_domain_added/device_list.json deleted file mode 100644 index b9291e763..000000000 --- a/fixtures/adam_plus_anna_copy_with_error_domain_added/device_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "b128b4bbbd1f47e9bf4d756e8fb5ee94", - "2743216f626f43948deec1f7ab3b3d70", - "aa6b0002df0a46e1b1eb94beb61eddfe", - "ee62cad889f94e8ca3d09021f03a660b", - "f2be121e4a9345ac83c6e99ed89a98be" -] diff --git a/fixtures/adam_plus_anna_copy_with_error_domain_added/notifications.json b/fixtures/adam_plus_anna_copy_with_error_domain_added/notifications.json deleted file mode 100644 index d383a99ea..000000000 --- a/fixtures/adam_plus_anna_copy_with_error_domain_added/notifications.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "3d28a20e17cb47dca210a132463721d5": { - "error": "ZigBee Stick 000D6F000D5A3184 has been unreachable since 05:36 2020-06-18. Please check if the ZigBee Stick is still inserted in the Gateway USB port and restart Gateway by powering it down for a few seconds." - }, - "af82e4ccf9c548528166d38e560662a4": { - "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." - } -} diff --git a/fixtures/adam_plus_anna_new/all_data.json b/fixtures/adam_plus_anna_new/all_data.json index 38d62d920..a9358167a 100644 --- a/fixtures/adam_plus_anna_new/all_data.json +++ b/fixtures/adam_plus_anna_new/all_data.json @@ -18,8 +18,8 @@ "model": "Generic heater", "name": "OpenTherm", "sensors": { - "intended_boiler_temperature": 20.0, - "water_temperature": 29.0 + "intended_boiler_temperature": 23.9, + "water_temperature": 30.0 }, "switches": { "dhw_cm_switch": false @@ -77,7 +77,7 @@ "model": "Plug", "name": "Plug Werkplek", "sensors": { - "electricity_consumed": 87.6, + "electricity_consumed": 91.3, "electricity_consumed_interval": 23.0, "electricity_produced": 0.0, "electricity_produced_interval": 0.0 diff --git a/fixtures/adam_plus_anna_new/device_list.json b/fixtures/adam_plus_anna_new/device_list.json deleted file mode 100644 index b4f3cf98f..000000000 --- a/fixtures/adam_plus_anna_new/device_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "da224107914542988a88561b4452b0f6", - "056ee145a816487eaa69243c3280f8bf", - "67d73d0bd469422db25a618a5fb8eeb0", - "e2f4322d57924fa090fbbc48b3a140dc", - "854f8a9b0e7e425db97f1f110e1ce4b3", - "ad4838d7d35c4d6ea796ee12ae5aedf8", - "29542b2b6a6a4169acecc15c72a599b8", - "1772a4ea304041adb83f357b751341ff", - "2568cc4b9c1e401495d4741a5f89bee1", - "e8ef2a01ed3b4139a53bf749204fe6b4" -] diff --git a/fixtures/adam_plus_anna_new/notifications.json b/fixtures/adam_plus_anna_new/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/adam_plus_anna_new/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/adam_zone_per_device/all_data.json b/fixtures/adam_zone_per_device/all_data.json index 43e85d00e..dfc599f84 100644 --- a/fixtures/adam_zone_per_device/all_data.json +++ b/fixtures/adam_zone_per_device/all_data.json @@ -28,7 +28,7 @@ "model": "Plug", "name": "Playstation Smart Plug", "sensors": { - "electricity_consumed": 81.2, + "electricity_consumed": 80.1, "electricity_consumed_interval": 12.7, "electricity_produced": 0.0, "electricity_produced_interval": 0.0 @@ -165,7 +165,7 @@ }, "90986d591dcd426cae3ec3e8111ff730": { "binary_sensors": { - "heating_state": false + "heating_state": true }, "dev_class": "heater_central", "location": "1f9dcf83fd4e4b66b72ff787957bfe5d", @@ -233,7 +233,7 @@ "setpoint": 21.5, "temperature": 26.2, "temperature_difference": 3.7, - "valve_position": 0.0 + "valve_position": 100 }, "temperature_offset": { "lower_bound": -2.0, diff --git a/fixtures/adam_zone_per_device/device_list.json b/fixtures/adam_zone_per_device/device_list.json deleted file mode 100644 index 104a723e4..000000000 --- a/fixtures/adam_zone_per_device/device_list.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - "fe799307f1624099878210aa0b9f1475", - "90986d591dcd426cae3ec3e8111ff730", - "df4a4a8169904cdb9c03d61a21f42140", - "b310b72a0e354bfab43089919b9a88bf", - "a2c3583e0a6349358998b760cea82d2a", - "b59bcebaf94b499ea7d46e4a66fb62d8", - "d3da73bde12a47d5a6b8f9dad971f2ec", - "21f2b542c49845e6bb416884c55778d6", - "78d1126fc4c743db81b61c20e88342a7", - "cd0ddb54ef694e11ac18ed1cbce5dbbd", - "4a810418d5394b3f82727340b91ba740", - "02cf28bfec924855854c544690a609ef", - "a28f588dc4a049a483fd03a30361ad3a", - "6a3bf693d05e48e0b460c815a4fdd09d", - "680423ff840043738f42cc7f1ff97a36", - "f1fee6043d3642a9b0a65297455f008e", - "675416a629f343c495449970e2ca37b5", - "e7693eb9582644e5b865dba8d4447cf1" -] diff --git a/fixtures/adam_zone_per_device/notifications.json b/fixtures/adam_zone_per_device/notifications.json deleted file mode 100644 index 8749be4c3..000000000 --- a/fixtures/adam_zone_per_device/notifications.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "af82e4ccf9c548528166d38e560662a4": { - "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." - } -} diff --git a/fixtures/anna_elga_2/device_list.json b/fixtures/anna_elga_2/device_list.json deleted file mode 100644 index e699b4bea..000000000 --- a/fixtures/anna_elga_2/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "fb49af122f6e4b0f91267e1cf7666d6f", - "573c152e7d4f4720878222bd75638f5b", - "ebd90df1ab334565b5895f37590ccff4" -] diff --git a/fixtures/anna_elga_2/notifications.json b/fixtures/anna_elga_2/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_elga_2/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_elga_2_cooling/device_list.json b/fixtures/anna_elga_2_cooling/device_list.json deleted file mode 100644 index e699b4bea..000000000 --- a/fixtures/anna_elga_2_cooling/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "fb49af122f6e4b0f91267e1cf7666d6f", - "573c152e7d4f4720878222bd75638f5b", - "ebd90df1ab334565b5895f37590ccff4" -] diff --git a/fixtures/anna_elga_2_cooling/notifications.json b/fixtures/anna_elga_2_cooling/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_elga_2_cooling/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_elga_2_schedule_off/all_data.json b/fixtures/anna_elga_2_schedule_off/all_data.json index 5fb99ddaa..1d502983e 100644 --- a/fixtures/anna_elga_2_schedule_off/all_data.json +++ b/fixtures/anna_elga_2_schedule_off/all_data.json @@ -25,7 +25,7 @@ "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, "modulation_level": 0.0, - "outdoor_air_temperature": 14.0, + "outdoor_air_temperature": 13.0, "return_temperature": 23.4, "water_pressure": 0.5, "water_temperature": 22.8 diff --git a/fixtures/anna_elga_2_schedule_off/device_list.json b/fixtures/anna_elga_2_schedule_off/device_list.json deleted file mode 100644 index e699b4bea..000000000 --- a/fixtures/anna_elga_2_schedule_off/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "fb49af122f6e4b0f91267e1cf7666d6f", - "573c152e7d4f4720878222bd75638f5b", - "ebd90df1ab334565b5895f37590ccff4" -] diff --git a/fixtures/anna_elga_2_schedule_off/notifications.json b/fixtures/anna_elga_2_schedule_off/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_elga_2_schedule_off/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_elga_no_cooling/device_list.json b/fixtures/anna_elga_no_cooling/device_list.json deleted file mode 100644 index ffb8cf625..000000000 --- a/fixtures/anna_elga_no_cooling/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "015ae9ea3f964e668e490fa39da3870b", - "1cbf783bb11e4a7c8a6843dee3a86927", - "3cb70739631c4d17a86b8b12e8a5161b" -] diff --git a/fixtures/anna_elga_no_cooling/notifications.json b/fixtures/anna_elga_no_cooling/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_elga_no_cooling/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_heatpump_cooling/all_data.json b/fixtures/anna_heatpump_cooling/all_data.json index 3367d32a9..95cceaa49 100644 --- a/fixtures/anna_heatpump_cooling/all_data.json +++ b/fixtures/anna_heatpump_cooling/all_data.json @@ -67,7 +67,7 @@ "sensors": { "cooling_activation_outdoor_temperature": 21.0, "cooling_deactivation_threshold": 6.0, - "illuminance": 25.5, + "illuminance": 24.5, "setpoint_high": 22.0, "setpoint_low": 4.0, "temperature": 22.3 diff --git a/fixtures/anna_heatpump_cooling/device_list.json b/fixtures/anna_heatpump_cooling/device_list.json deleted file mode 100644 index ffb8cf625..000000000 --- a/fixtures/anna_heatpump_cooling/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "015ae9ea3f964e668e490fa39da3870b", - "1cbf783bb11e4a7c8a6843dee3a86927", - "3cb70739631c4d17a86b8b12e8a5161b" -] diff --git a/fixtures/anna_heatpump_cooling/notifications.json b/fixtures/anna_heatpump_cooling/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_heatpump_cooling/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/all_data.json b/fixtures/anna_heatpump_cooling_fake_firmware/all_data.json index 9d0b3b546..71cff7131 100644 --- a/fixtures/anna_heatpump_cooling_fake_firmware/all_data.json +++ b/fixtures/anna_heatpump_cooling_fake_firmware/all_data.json @@ -67,7 +67,7 @@ "sensors": { "cooling_activation_outdoor_temperature": 21.0, "cooling_deactivation_threshold": 6.0, - "illuminance": 25.5, + "illuminance": 24.5, "setpoint_high": 22.0, "setpoint_low": 4.0, "temperature": 22.3 diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/device_list.json b/fixtures/anna_heatpump_cooling_fake_firmware/device_list.json deleted file mode 100644 index ffb8cf625..000000000 --- a/fixtures/anna_heatpump_cooling_fake_firmware/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "015ae9ea3f964e668e490fa39da3870b", - "1cbf783bb11e4a7c8a6843dee3a86927", - "3cb70739631c4d17a86b8b12e8a5161b" -] diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/notifications.json b/fixtures/anna_heatpump_cooling_fake_firmware/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_heatpump_cooling_fake_firmware/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_heatpump_heating/device_list.json b/fixtures/anna_heatpump_heating/device_list.json deleted file mode 100644 index ffb8cf625..000000000 --- a/fixtures/anna_heatpump_heating/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "015ae9ea3f964e668e490fa39da3870b", - "1cbf783bb11e4a7c8a6843dee3a86927", - "3cb70739631c4d17a86b8b12e8a5161b" -] diff --git a/fixtures/anna_heatpump_heating/notifications.json b/fixtures/anna_heatpump_heating/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_heatpump_heating/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_loria_cooling_active/all_data.json b/fixtures/anna_loria_cooling_active/all_data.json index 2e68ccc5a..2497c698b 100644 --- a/fixtures/anna_loria_cooling_active/all_data.json +++ b/fixtures/anna_loria_cooling_active/all_data.json @@ -52,6 +52,7 @@ "bfb5ee0a88e14e5f97bfa725a760cc49": { "available": true, "binary_sensors": { + "cooling_enabled": true, "cooling_state": true, "dhw_state": false, "flame_state": false, @@ -79,7 +80,7 @@ "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, "modulation_level": 100, - "outdoor_air_temperature": 17.3, + "outdoor_air_temperature": 17.2, "return_temperature": 26.3, "water_temperature": 25.3 }, @@ -94,7 +95,7 @@ "cooling_present": true, "gateway_id": "9ff0569b4984459fb243af64c0901894", "heater_id": "bfb5ee0a88e14e5f97bfa725a760cc49", - "item_count": 63, + "item_count": 64, "notifications": {}, "smile_name": "Smile Anna" } diff --git a/fixtures/anna_loria_cooling_active/device_list.json b/fixtures/anna_loria_cooling_active/device_list.json deleted file mode 100644 index 4b555a74f..000000000 --- a/fixtures/anna_loria_cooling_active/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "9ff0569b4984459fb243af64c0901894", - "bfb5ee0a88e14e5f97bfa725a760cc49", - "582dfbdace4d4aeb832923ce7d1ddda0" -] diff --git a/fixtures/anna_loria_cooling_active/notifications.json b/fixtures/anna_loria_cooling_active/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_loria_cooling_active/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_loria_driessens/all_data.json b/fixtures/anna_loria_driessens/all_data.json index 5af80a68e..b80e1b77d 100644 --- a/fixtures/anna_loria_driessens/all_data.json +++ b/fixtures/anna_loria_driessens/all_data.json @@ -58,6 +58,7 @@ "a449cbc334ae4a5bb7f89064984b2906": { "available": true, "binary_sensors": { + "cooling_enabled": false, "cooling_state": false, "dhw_state": false, "flame_state": false, @@ -85,7 +86,7 @@ "dhw_temperature": 49.5, "intended_boiler_temperature": 0.0, "modulation_level": 0.0, - "outdoor_air_temperature": 7.63, + "outdoor_air_temperature": 7.5, "return_temperature": 23.0, "water_temperature": 23.3 }, @@ -100,7 +101,7 @@ "cooling_present": true, "gateway_id": "5c118b1842e943c0a5b6ef88a60bb17a", "heater_id": "a449cbc334ae4a5bb7f89064984b2906", - "item_count": 63, + "item_count": 64, "notifications": {}, "smile_name": "Smile Anna" } diff --git a/fixtures/anna_loria_driessens/device_list.json b/fixtures/anna_loria_driessens/device_list.json deleted file mode 100644 index 997b8a4c8..000000000 --- a/fixtures/anna_loria_driessens/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "5c118b1842e943c0a5b6ef88a60bb17a", - "a449cbc334ae4a5bb7f89064984b2906", - "9fb768d699e44c7fb5cc50309dc4e7d4" -] diff --git a/fixtures/anna_loria_driessens/notifications.json b/fixtures/anna_loria_driessens/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_loria_driessens/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_loria_heating_idle/all_data.json b/fixtures/anna_loria_heating_idle/all_data.json index 4e7dd248c..713e75228 100644 --- a/fixtures/anna_loria_heating_idle/all_data.json +++ b/fixtures/anna_loria_heating_idle/all_data.json @@ -52,6 +52,7 @@ "bfb5ee0a88e14e5f97bfa725a760cc49": { "available": true, "binary_sensors": { + "cooling_enabled": false, "cooling_state": false, "dhw_state": false, "flame_state": false, @@ -79,7 +80,7 @@ "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, "modulation_level": 0.0, - "outdoor_air_temperature": 17.3, + "outdoor_air_temperature": 17.2, "return_temperature": 26.3, "water_temperature": 25.3 }, @@ -94,7 +95,7 @@ "cooling_present": true, "gateway_id": "9ff0569b4984459fb243af64c0901894", "heater_id": "bfb5ee0a88e14e5f97bfa725a760cc49", - "item_count": 63, + "item_count": 64, "notifications": {}, "smile_name": "Smile Anna" } diff --git a/fixtures/anna_loria_heating_idle/device_list.json b/fixtures/anna_loria_heating_idle/device_list.json deleted file mode 100644 index 4b555a74f..000000000 --- a/fixtures/anna_loria_heating_idle/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "9ff0569b4984459fb243af64c0901894", - "bfb5ee0a88e14e5f97bfa725a760cc49", - "582dfbdace4d4aeb832923ce7d1ddda0" -] diff --git a/fixtures/anna_loria_heating_idle/notifications.json b/fixtures/anna_loria_heating_idle/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_loria_heating_idle/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_v4/all_data.json b/fixtures/anna_v4/all_data.json index 0fc8a5a33..1716ed40b 100644 --- a/fixtures/anna_v4/all_data.json +++ b/fixtures/anna_v4/all_data.json @@ -13,9 +13,9 @@ "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "off", "sensors": { - "illuminance": 40.5, + "illuminance": 60.0, "setpoint": 20.5, - "temperature": 20.5 + "temperature": 20.6 }, "temperature_offset": { "lower_bound": -2.0, @@ -51,7 +51,7 @@ "available": true, "binary_sensors": { "dhw_state": false, - "flame_state": true, + "flame_state": false, "heating_state": true }, "dev_class": "heater_central", @@ -71,11 +71,11 @@ "model": "2.32", "name": "OpenTherm", "sensors": { - "intended_boiler_temperature": 48.6, + "intended_boiler_temperature": 39.9, "modulation_level": 0.0, - "return_temperature": 42.0, - "water_pressure": 2.1, - "water_temperature": 52.0 + "return_temperature": 32.0, + "water_pressure": 2.2, + "water_temperature": 45.0 }, "switches": { "dhw_cm_switch": false diff --git a/fixtures/anna_v4/device_list.json b/fixtures/anna_v4/device_list.json deleted file mode 100644 index 8b5a84080..000000000 --- a/fixtures/anna_v4/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "0466eae8520144c78afb29628384edeb", - "cd0e6156b1f04d5f952349ffbe397481", - "01b85360fdd243d0aaad4d6ac2a5ba7e" -] diff --git a/fixtures/anna_v4/notifications.json b/fixtures/anna_v4/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_v4/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_v4_dhw/all_data.json b/fixtures/anna_v4_dhw/all_data.json index fe2a1f9b2..cc0a04d77 100644 --- a/fixtures/anna_v4_dhw/all_data.json +++ b/fixtures/anna_v4_dhw/all_data.json @@ -13,9 +13,9 @@ "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "off", "sensors": { - "illuminance": 40.5, + "illuminance": 60.0, "setpoint": 20.5, - "temperature": 20.5 + "temperature": 20.6 }, "temperature_offset": { "lower_bound": -2.0, @@ -71,11 +71,11 @@ "model": "2.32", "name": "OpenTherm", "sensors": { - "intended_boiler_temperature": 48.6, + "intended_boiler_temperature": 39.9, "modulation_level": 0.0, - "return_temperature": 42.0, - "water_pressure": 2.1, - "water_temperature": 52.0 + "return_temperature": 32.0, + "water_pressure": 2.2, + "water_temperature": 45.0 }, "switches": { "dhw_cm_switch": false diff --git a/fixtures/anna_v4_dhw/device_list.json b/fixtures/anna_v4_dhw/device_list.json deleted file mode 100644 index 8b5a84080..000000000 --- a/fixtures/anna_v4_dhw/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "0466eae8520144c78afb29628384edeb", - "cd0e6156b1f04d5f952349ffbe397481", - "01b85360fdd243d0aaad4d6ac2a5ba7e" -] diff --git a/fixtures/anna_v4_dhw/notifications.json b/fixtures/anna_v4_dhw/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_v4_dhw/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_v4_no_tag/all_data.json b/fixtures/anna_v4_no_tag/all_data.json index e21c1d6fc..a0644f415 100644 --- a/fixtures/anna_v4_no_tag/all_data.json +++ b/fixtures/anna_v4_no_tag/all_data.json @@ -13,9 +13,9 @@ "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "Thuiswerken", "sensors": { - "illuminance": 40.5, + "illuminance": 60.0, "setpoint": 20.5, - "temperature": 20.5 + "temperature": 20.6 }, "temperature_offset": { "lower_bound": -2.0, @@ -71,11 +71,11 @@ "model": "2.32", "name": "OpenTherm", "sensors": { - "intended_boiler_temperature": 48.6, + "intended_boiler_temperature": 39.9, "modulation_level": 0.0, - "return_temperature": 42.0, - "water_pressure": 2.1, - "water_temperature": 52.0 + "return_temperature": 32.0, + "water_pressure": 2.2, + "water_temperature": 45.0 }, "switches": { "dhw_cm_switch": false diff --git a/fixtures/anna_v4_no_tag/device_list.json b/fixtures/anna_v4_no_tag/device_list.json deleted file mode 100644 index 8b5a84080..000000000 --- a/fixtures/anna_v4_no_tag/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "0466eae8520144c78afb29628384edeb", - "cd0e6156b1f04d5f952349ffbe397481", - "01b85360fdd243d0aaad4d6ac2a5ba7e" -] diff --git a/fixtures/anna_v4_no_tag/notifications.json b/fixtures/anna_v4_no_tag/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_v4_no_tag/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/anna_without_boiler_fw441/device_list.json b/fixtures/anna_without_boiler_fw441/device_list.json deleted file mode 100644 index ae8e35991..000000000 --- a/fixtures/anna_without_boiler_fw441/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "a270735e4ccd45239424badc0578a2b1", - "c46b4794d28149699eacf053deedd003", - "7ffbb3ab4b6c4ab2915d7510f7bf8fe9" -] diff --git a/fixtures/anna_without_boiler_fw441/notifications.json b/fixtures/anna_without_boiler_fw441/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/anna_without_boiler_fw441/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/legacy_anna/device_list.json b/fixtures/legacy_anna/device_list.json deleted file mode 100644 index f28d5b98e..000000000 --- a/fixtures/legacy_anna/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "0000aaaa0000aaaa0000aaaa0000aa00", - "04e4cbfe7f4340f090f85ec3b9e6a950", - "0d266432d64443e283b5d708ae98b455" -] diff --git a/fixtures/legacy_anna/notifications.json b/fixtures/legacy_anna/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/legacy_anna/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/legacy_anna_2/device_list.json b/fixtures/legacy_anna_2/device_list.json deleted file mode 100644 index c64b49a29..000000000 --- a/fixtures/legacy_anna_2/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "be81e3f8275b4129852c4d8d550ae2eb", - "ea5d8a7177e541b0a4b52da815166de4", - "9e7377867dc24e51b8098a5ba02bd89d" -] diff --git a/fixtures/legacy_anna_2/notifications.json b/fixtures/legacy_anna_2/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/legacy_anna_2/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/m_adam_cooling/device_list.json b/fixtures/m_adam_cooling/device_list.json deleted file mode 100644 index 35fe367eb..000000000 --- a/fixtures/m_adam_cooling/device_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "da224107914542988a88561b4452b0f6", - "056ee145a816487eaa69243c3280f8bf", - "e2f4322d57924fa090fbbc48b3a140dc", - "ad4838d7d35c4d6ea796ee12ae5aedf8", - "1772a4ea304041adb83f357b751341ff", - "e8ef2a01ed3b4139a53bf749204fe6b4" -] diff --git a/fixtures/m_adam_cooling/notifications.json b/fixtures/m_adam_cooling/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/m_adam_cooling/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/m_adam_heating/device_list.json b/fixtures/m_adam_heating/device_list.json deleted file mode 100644 index 35fe367eb..000000000 --- a/fixtures/m_adam_heating/device_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "da224107914542988a88561b4452b0f6", - "056ee145a816487eaa69243c3280f8bf", - "e2f4322d57924fa090fbbc48b3a140dc", - "ad4838d7d35c4d6ea796ee12ae5aedf8", - "1772a4ea304041adb83f357b751341ff", - "e8ef2a01ed3b4139a53bf749204fe6b4" -] diff --git a/fixtures/m_adam_heating/notifications.json b/fixtures/m_adam_heating/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/m_adam_heating/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/m_adam_jip/all_data.json b/fixtures/m_adam_jip/all_data.json index 915f438c1..378a5e0a7 100644 --- a/fixtures/m_adam_jip/all_data.json +++ b/fixtures/m_adam_jip/all_data.json @@ -67,7 +67,7 @@ "name": "Tom Slaapkamer", "sensors": { "setpoint": 13.0, - "temperature": 24.3, + "temperature": 24.2, "temperature_difference": 1.7, "valve_position": 0.0 }, diff --git a/fixtures/m_adam_jip/device_list.json b/fixtures/m_adam_jip/device_list.json deleted file mode 100644 index 049845bc8..000000000 --- a/fixtures/m_adam_jip/device_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "b5c2386c6f6342669e50fe49dd05b188", - "e4684553153b44afbef2200885f379dc", - "a6abc6a129ee499c88a4d420cc413b47", - "1346fbd8498d4dbcab7e18d51b771f3d", - "833de10f269c4deab58fb9df69901b4e", - "6f3e9d7084214c21b9dfa46f6eeb8700", - "f61f1a2535f54f52ad006a3d18e459ca", - "d4496250d0e942cfa7aea3476e9070d5", - "356b65335e274d769c338223e7af9c33", - "1da4d325838e4ad8aac12177214505c9", - "457ce8414de24596a2d5e7dbc9c7682f" -] diff --git a/fixtures/m_adam_jip/notifications.json b/fixtures/m_adam_jip/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/m_adam_jip/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/m_anna_heatpump_cooling/device_list.json b/fixtures/m_anna_heatpump_cooling/device_list.json deleted file mode 100644 index ffb8cf625..000000000 --- a/fixtures/m_anna_heatpump_cooling/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "015ae9ea3f964e668e490fa39da3870b", - "1cbf783bb11e4a7c8a6843dee3a86927", - "3cb70739631c4d17a86b8b12e8a5161b" -] diff --git a/fixtures/m_anna_heatpump_cooling/notifications.json b/fixtures/m_anna_heatpump_cooling/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/m_anna_heatpump_cooling/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/m_anna_heatpump_idle/device_list.json b/fixtures/m_anna_heatpump_idle/device_list.json deleted file mode 100644 index ffb8cf625..000000000 --- a/fixtures/m_anna_heatpump_idle/device_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "015ae9ea3f964e668e490fa39da3870b", - "1cbf783bb11e4a7c8a6843dee3a86927", - "3cb70739631c4d17a86b8b12e8a5161b" -] diff --git a/fixtures/m_anna_heatpump_idle/notifications.json b/fixtures/m_anna_heatpump_idle/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/m_anna_heatpump_idle/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/p1v4/all_data.json b/fixtures/p1v4/all_data.json index 95dfdf7f2..4d841de79 100644 --- a/fixtures/p1v4/all_data.json +++ b/fixtures/p1v4/all_data.json @@ -25,7 +25,7 @@ "electricity_consumed_off_peak_point": 0, "electricity_consumed_peak_cumulative": 9067.554, "electricity_consumed_peak_interval": 335, - "electricity_consumed_peak_point": 548, + "electricity_consumed_peak_point": 571, "electricity_produced_off_peak_cumulative": 0.0, "electricity_produced_off_peak_interval": 0, "electricity_produced_off_peak_point": 0, @@ -33,7 +33,7 @@ "electricity_produced_peak_interval": 0, "electricity_produced_peak_point": 0, "net_electricity_cumulative": 20983.453, - "net_electricity_point": 548 + "net_electricity_point": 571 }, "vendor": "SHENZHEN KAIFA TECHNOLOGY CHENGDU CO." } diff --git a/fixtures/p1v4/device_list.json b/fixtures/p1v4/device_list.json deleted file mode 100644 index d8acf2e4a..000000000 --- a/fixtures/p1v4/device_list.json +++ /dev/null @@ -1 +0,0 @@ -["a455b61e52394b2db5081ce025a430f3", "ba4de7613517478da82dd9b6abea36af"] diff --git a/fixtures/p1v4/notifications.json b/fixtures/p1v4/notifications.json deleted file mode 100644 index f232f8266..000000000 --- a/fixtures/p1v4/notifications.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "97a04c0c263049b29350a660b4cdd01e": { - "warning": "The Smile P1 does not seem to be connected to a smart meter." - } -} diff --git a/fixtures/p1v4_442_single/all_data.json b/fixtures/p1v4_442_single/all_data.json index 731191ec0..318035a5d 100644 --- a/fixtures/p1v4_442_single/all_data.json +++ b/fixtures/p1v4_442_single/all_data.json @@ -20,13 +20,13 @@ "model": "KFM5KAIFA-METER", "name": "P1", "sensors": { - "electricity_consumed_off_peak_cumulative": 17643.505, - "electricity_consumed_off_peak_interval": 21, - "electricity_consumed_off_peak_point": 421, + "electricity_consumed_off_peak_cumulative": 17643.423, + "electricity_consumed_off_peak_interval": 15, + "electricity_consumed_off_peak_point": 486, "electricity_consumed_peak_cumulative": 13966.608, "electricity_consumed_peak_interval": 0, "electricity_consumed_peak_point": 0, - "electricity_phase_one_consumed": 413, + "electricity_phase_one_consumed": 486, "electricity_phase_one_produced": 0, "electricity_produced_off_peak_cumulative": 0.0, "electricity_produced_off_peak_interval": 0, @@ -34,8 +34,8 @@ "electricity_produced_peak_cumulative": 0.0, "electricity_produced_peak_interval": 0, "electricity_produced_peak_point": 0, - "net_electricity_cumulative": 31610.113, - "net_electricity_point": 421 + "net_electricity_cumulative": 31610.031, + "net_electricity_point": 486 }, "vendor": "SHENZHEN KAIFA TECHNOLOGY \uff08CHENGDU\uff09 CO., LTD." } diff --git a/fixtures/p1v4_442_single/device_list.json b/fixtures/p1v4_442_single/device_list.json deleted file mode 100644 index d8acf2e4a..000000000 --- a/fixtures/p1v4_442_single/device_list.json +++ /dev/null @@ -1 +0,0 @@ -["a455b61e52394b2db5081ce025a430f3", "ba4de7613517478da82dd9b6abea36af"] diff --git a/fixtures/p1v4_442_single/notifications.json b/fixtures/p1v4_442_single/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/p1v4_442_single/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/p1v4_442_triple/device_list.json b/fixtures/p1v4_442_triple/device_list.json deleted file mode 100644 index 7b301f509..000000000 --- a/fixtures/p1v4_442_triple/device_list.json +++ /dev/null @@ -1 +0,0 @@ -["03e65b16e4b247a29ae0d75a78cb492e", "b82b6b3322484f2ea4e25e0bd5f3d61f"] diff --git a/fixtures/p1v4_442_triple/notifications.json b/fixtures/p1v4_442_triple/notifications.json deleted file mode 100644 index 49db06203..000000000 --- a/fixtures/p1v4_442_triple/notifications.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "97a04c0c263049b29350a660b4cdd01e": { - "warning": "The Smile P1 is not connected to a smart meter." - } -} diff --git a/fixtures/smile_p1_v2/device_list.json b/fixtures/smile_p1_v2/device_list.json deleted file mode 100644 index ceadb09f0..000000000 --- a/fixtures/smile_p1_v2/device_list.json +++ /dev/null @@ -1 +0,0 @@ -["aaaa0000aaaa0000aaaa0000aaaa00aa", "938696c4bcdb4b8a9a595cb38ed43913"] diff --git a/fixtures/smile_p1_v2/notifications.json b/fixtures/smile_p1_v2/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/smile_p1_v2/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/smile_p1_v2_2/device_list.json b/fixtures/smile_p1_v2_2/device_list.json deleted file mode 100644 index f0bdb6dda..000000000 --- a/fixtures/smile_p1_v2_2/device_list.json +++ /dev/null @@ -1 +0,0 @@ -["aaaa0000aaaa0000aaaa0000aaaa00aa", "199aa40f126840f392983d171374ab0b"] diff --git a/fixtures/smile_p1_v2_2/notifications.json b/fixtures/smile_p1_v2_2/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/smile_p1_v2_2/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/stretch_v23/device_list.json b/fixtures/stretch_v23/device_list.json deleted file mode 100644 index d0364c7c9..000000000 --- a/fixtures/stretch_v23/device_list.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - "0000aaaa0000aaaa0000aaaa0000aa00", - "09c8ce93d7064fa6a233c0e4c2449bfe", - "33a1c784a9ff4c2d8766a0212714be09", - "199fd4b2caa44197aaf5b3128f6464ed", - "713427748874454ca1eb4488d7919cf2", - "fd1b74f59e234a9dae4e23b2b5cf07ed", - "c71f1cb2100b42ca942f056dcb7eb01f", - "2cc9a0fe70ef4441a9e4f55dfd64b776", - "6518f3f72a82486c97b91e26f2e9bd1d", - "828f6ce1e36744689baacdd6ddb1d12c", - "71e3e65ffc5a41518b19460c6e8ee34f", - "305452ce97c243c0a7b4ab2a4ebfe6e3", - "bc0adbebc50d428d9444a5d805c89da9", - "407aa1c1099d463c9137a3a9eda787fd", - "2587a7fcdd7e482dab03fda256076b4b", - "a28e6f5afc0e4fc68498c1f03e82a052", - "24b2ed37c8964c73897db6340a39c129", - "f7b145c8492f4dd7a4de760456fdef3e" -] diff --git a/fixtures/stretch_v23/notifications.json b/fixtures/stretch_v23/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/stretch_v23/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/stretch_v27_no_domain/device_list.json b/fixtures/stretch_v27_no_domain/device_list.json deleted file mode 100644 index b166d8fbd..000000000 --- a/fixtures/stretch_v27_no_domain/device_list.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - "0000aaaa0000aaaa0000aaaa0000aa00", - "8b8d14b242e24cd789743c828b9a2ea9", - "8e4ecdcc9094481387e0273437bb51f9", - "9b9bfdb3c7ad4ca5817ccaa235f1e094", - "4661019bbe7b4a3bbe39f345ca5b5d98", - "5ee135e752034ad2a3e38a407332757f", - "ad858f416f3e42e6a25bbd6b18178b0e", - "e4172142264f488a99b63c73817c9d21", - "0b078d5862614880bc670cabf9f54b4e", - "553dfa416df94802851de32913f1ebd3", - "d0122ac66eba47b99d8e5fbd1e2f5932", - "9db23f92fd114e83acce036b6cb82295", - "3b729c63ca41421b9e21264adfa0a4e7", - "7c7f0d3da801402291b057f9ec69b5b6" -] diff --git a/fixtures/stretch_v27_no_domain/notifications.json b/fixtures/stretch_v27_no_domain/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/stretch_v27_no_domain/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/fixtures/stretch_v31/all_data.json b/fixtures/stretch_v31/all_data.json index 6b1012b0d..f42cde65b 100644 --- a/fixtures/stretch_v31/all_data.json +++ b/fixtures/stretch_v31/all_data.json @@ -23,7 +23,7 @@ "electricity_produced": 0.0 }, "switches": { - "lock": false, + "lock": true, "relay": true }, "vendor": "Plugwise", diff --git a/fixtures/stretch_v31/device_list.json b/fixtures/stretch_v31/device_list.json deleted file mode 100644 index b2c839ae9..000000000 --- a/fixtures/stretch_v31/device_list.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - "0000aaaa0000aaaa0000aaaa0000aa00", - "5871317346d045bc9f6b987ef25ee638", - "e1c884e7dede431dadee09506ec4f859", - "aac7b735042c4832ac9ff33aae4f453b", - "cfe95cf3de1948c0b8955125bf754614", - "059e4d03c7a34d278add5c7a4a781d19", - "d950b314e9d8499f968e6db8d82ef78c", - "d03738edfcc947f7b8f4573571d90d2d" -] diff --git a/fixtures/stretch_v31/notifications.json b/fixtures/stretch_v31/notifications.json deleted file mode 100644 index 0967ef424..000000000 --- a/fixtures/stretch_v31/notifications.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugwise/__init__.py b/plugwise/__init__.py index e1d96e0de..c0ddf187e 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -4,333 +4,39 @@ """ from __future__ import annotations -import datetime as dt - -import aiohttp -from defusedxml import ElementTree as etree - -# Dict as class -from munch import Munch - -# Version detection -import semver - -from .constants import ( - ADAM, - ANNA, - APPLIANCES, +from plugwise.constants import ( DEFAULT_PORT, DEFAULT_TIMEOUT, DEFAULT_USERNAME, DOMAIN_OBJECTS, - LOCATIONS, LOGGER, - MAX_SETPOINT, - MIN_SETPOINT, MODULES, NONE, - NOTIFICATIONS, - OFF, - REQUIRE_APPLIANCES, - RULES, SMILES, STATUS, - SWITCH_GROUP_TYPES, SYSTEM, - ZONE_THERMOSTATS, - ActuatorData, - DeviceData, - GatewayData, PlugwiseData, + ThermoLoc, ) -from .exceptions import ( +from plugwise.exceptions import ( InvalidSetupError, PlugwiseError, ResponseError, UnsupportedDeviceError, ) -from .helper import SmileComm, SmileHelper - - -def remove_empty_platform_dicts(data: DeviceData) -> None: - """Helper-function for removing any empty platform dicts.""" - if not data["binary_sensors"]: - data.pop("binary_sensors") - if not data["sensors"]: - data.pop("sensors") - if not data["switches"]: - data.pop("switches") - - -class SmileData(SmileHelper): - """The Plugwise Smile main class.""" - - def _update_gw_devices(self) -> None: - """Helper-function for _all_device_data() and async_update(). - - Collect data for each device and add to self.gw_devices. - """ - for device_id, device in self.gw_devices.items(): - data = self._get_device_data(device_id) - self._add_or_update_notifications(device_id, device, data) - device.update(data) - self._update_for_cooling(device) - remove_empty_platform_dicts(device) - - def _add_or_update_notifications( - self, device_id: str, device: DeviceData, data: DeviceData - ) -> None: - """Helper-function adding or updating the Plugwise notifications.""" - if ( - device_id == self.gateway_id - and ( - self._is_thermostat - or (self.smile_type == "power" and not self._smile_legacy) - ) - ) or ( - "binary_sensors" in device - and "plugwise_notification" in device["binary_sensors"] - ): - data["binary_sensors"]["plugwise_notification"] = bool(self._notifications) - self._count += 1 - - def _update_for_cooling(self, device: DeviceData) -> None: - """Helper-function for adding/updating various cooling-related values.""" - # For Anna and heating + cooling, replace setpoint with setpoint_high/_low - if ( - self.smile(ANNA) - and self._cooling_present - and device["dev_class"] == "thermostat" - ): - thermostat = device["thermostat"] - sensors = device["sensors"] - temp_dict: ActuatorData = { - "setpoint_low": thermostat["setpoint"], - "setpoint_high": MAX_SETPOINT, - } - if self._cooling_enabled: - temp_dict = { - "setpoint_low": MIN_SETPOINT, - "setpoint_high": thermostat["setpoint"], - } - thermostat.pop("setpoint") - temp_dict.update(thermostat) - device["thermostat"] = temp_dict - if "setpoint" in sensors: - sensors.pop("setpoint") - sensors["setpoint_low"] = temp_dict["setpoint_low"] - sensors["setpoint_high"] = temp_dict["setpoint_high"] - self._count += 2 - - def get_all_devices(self) -> None: - """Determine the evices present from the obtained XML-data. - - Run this functions once to gather the initial device configuration, - then regularly run async_update() to refresh the device data. - """ - # Gather all the devices and their initial data - self._all_appliances() - if self._is_thermostat: - self._scan_thermostats() - # Collect a list of thermostats with offset-capability - self.therms_with_offset_func = ( - self._get_appliances_with_offset_functionality() - ) - - # Collect and add switching- and/or pump-group devices - if group_data := self._get_group_switches(): - self.gw_devices.update(group_data) - - # Collect the remaining data for all devices - self._all_device_data() - - def _all_device_data(self) -> None: - """Helper-function for get_all_devices(). - - Collect data for each device and add to self.gw_data and self.gw_devices. - """ - self._update_gw_devices() - self.device_items = self._count - self.device_list = [] - for device in self.gw_devices: - self.device_list.append(device) - - self.gw_data.update( - { - "gateway_id": self.gateway_id, - "item_count": self._count, - "notifications": self._notifications, - "smile_name": self.smile_name, - } - ) - if self._is_thermostat: - self.gw_data.update( - {"heater_id": self._heater_id, "cooling_present": self._cooling_present} - ) - - def _device_data_switching_group( - self, device: DeviceData, data: DeviceData - ) -> None: - """Helper-function for _get_device_data(). - - Determine switching group device data. - """ - if device["dev_class"] in SWITCH_GROUP_TYPES: - counter = 0 - for member in device["members"]: - if self.gw_devices[member]["switches"].get("relay"): - counter += 1 - data["switches"]["relay"] = counter != 0 - self._count += 1 - - def _device_data_adam(self, device: DeviceData, data: DeviceData) -> None: - """Helper-function for _get_device_data(). - - Determine Adam heating-status for on-off heating via valves, - available regulations_modes and thermostat control_states. - """ - if self.smile(ADAM): - # Indicate heating_state based on valves being open in case of city-provided heating - if ( - device["dev_class"] == "heater_central" - and self._on_off_device - and isinstance(self._heating_valves(), int) - ): - data["binary_sensors"]["heating_state"] = self._heating_valves() != 0 - - # Show the allowed regulation modes and gateway_modes - if device["dev_class"] == "gateway": - if self._reg_allowed_modes: - data["regulation_modes"] = self._reg_allowed_modes - self._count += 1 - if self._gw_allowed_modes: - data["gateway_modes"] = self._gw_allowed_modes - self._count += 1 - - # Control_state, only for Adam master thermostats - if device["dev_class"] in ZONE_THERMOSTATS: - loc_id = device["location"] - if ctrl_state := self._control_state(loc_id): - data["control_state"] = ctrl_state - self._count += 1 - - def _device_data_climate(self, device: DeviceData, data: DeviceData) -> None: - """Helper-function for _get_device_data(). - - Determine climate-control device data. - """ - loc_id = device["location"] - - # Presets - data["preset_modes"] = None - data["active_preset"] = None - self._count += 2 - if presets := self._presets(loc_id): - data["preset_modes"] = list(presets) - data["active_preset"] = self._preset(loc_id) - - # Schedule - avail_schedules, sel_schedule = self._schedules(loc_id) - data["available_schedules"] = avail_schedules - data["select_schedule"] = sel_schedule - self._count += 2 - - # Operation modes: auto, heat, heat_cool, cool and off - data["mode"] = "auto" - self._count += 1 - if sel_schedule == NONE: - data["mode"] = "heat" - if self._cooling_present: - data["mode"] = "cool" if self.check_reg_mode("cooling") else "heat_cool" - - if self.check_reg_mode("off"): - data["mode"] = "off" - - if NONE not in avail_schedules: - self._get_schedule_states_with_off( - loc_id, avail_schedules, sel_schedule, data - ) - - def check_reg_mode(self, mode: str) -> bool: - """Helper-function for device_data_climate().""" - gateway = self.gw_devices[self.gateway_id] - return ( - "regulation_modes" in gateway and gateway["select_regulation_mode"] == mode - ) +from plugwise.helper import SmileComm +from plugwise.legacy.smile import SmileLegacyAPI +from plugwise.smile import SmileAPI - def _get_schedule_states_with_off( - self, location: str, schedules: list[str], selected: str, data: DeviceData - ) -> None: - """Collect schedules with states for each thermostat. - - Also, replace NONE by OFF when none of the schedules are active, - only for non-legacy thermostats. - """ - loc_schedule_states: dict[str, str] = {} - for schedule in schedules: - loc_schedule_states[schedule] = "off" - if schedule == selected and data["mode"] == "auto": - loc_schedule_states[schedule] = "on" - self._schedule_old_states[location] = loc_schedule_states - - all_off = True - if not self._smile_legacy: - for state in self._schedule_old_states[location].values(): - if state == "on": - all_off = False - if all_off: - data["select_schedule"] = OFF - - def _check_availability( - self, device: DeviceData, dev_class: str, data: DeviceData, message: str - ) -> None: - """Helper-function for _get_device_data(). - - Provide availability status for the wired-commected devices. - """ - if device["dev_class"] == dev_class: - data["available"] = True - self._count += 1 - for item in self._notifications.values(): - for msg in item.values(): - if message in msg: - data["available"] = False - - def _get_device_data(self, dev_id: str) -> DeviceData: - """Helper-function for _all_device_data() and async_update(). - - Provide device-data, based on Location ID (= dev_id), from APPLIANCES. - """ - device = self.gw_devices[dev_id] - data = self._get_measurement_data(dev_id) - - # Check availability of non-legacy wired-connected devices - if not self._smile_legacy: - # Smartmeter - self._check_availability( - device, "smartmeter", data, "P1 does not seem to be connected" - ) - # OpenTherm device - if device["name"] != "OnOff": - self._check_availability( - device, "heater_central", data, "no OpenTherm communication" - ) - - # Switching groups data - self._device_data_switching_group(device, data) - # Adam data - self._device_data_adam(device, data) - # Skip obtaining data for non master-thermostats - if device["dev_class"] not in ZONE_THERMOSTATS: - return data - - # Thermostat data (presets, temperatures etc) - self._device_data_climate(device, data) +import aiohttp +from defusedxml import ElementTree as etree - return data +# Dict as class +# Version detection +import semver -class Smile(SmileComm, SmileData): +class Smile(SmileComm): """The Plugwise SmileConnect class.""" # pylint: disable=too-many-instance-attributes, too-many-public-methods @@ -339,30 +45,56 @@ def __init__( self, host: str, password: str, + websession: aiohttp.ClientSession, username: str = DEFAULT_USERNAME, port: int = DEFAULT_PORT, timeout: float = DEFAULT_TIMEOUT, - websession: aiohttp.ClientSession | None = None, + ) -> None: """Set the constructor for this class.""" super().__init__( host, password, + websession, username, port, timeout, - websession, ) - SmileData.__init__(self) - self.smile_hostname: str | None = None - self._previous_day_number: str = "0" - self._target_smile: str | None = None + self._host = host + self._passwd = password + self._websession = websession + self._user = username + self._port = port + self._timeout = timeout + + self._cooling_present = False + self._elga = False + self._is_thermostat = False + self._last_active: dict[str, str | None] = {} + self._on_off_device = False + self._opentherm_device = False + self._schedule_old_states: dict[str, dict[str, str]] = {} + self._smile_api: SmileAPI | SmileLegacyAPI + self._stretch_v2 = False + self._target_smile: str = NONE + self.gateway_id: str = NONE + self.loc_data: dict[str, ThermoLoc] = {} + self.smile_fw_version: str | None + self.smile_hostname: str + self.smile_hw_version: str | None = None + self.smile_legacy = False + self.smile_mac_address: str | None + self.smile_model: str + self.smile_name: str + self.smile_type: str + self.smile_version: tuple[str, semver.version.Version] + self.smile_zigbee_mac_address: str | None = None async def connect(self) -> bool: """Connect to Plugwise device and determine its name, type and version.""" result = await self._request(DOMAIN_OBJECTS) - # Work-around for Stretch fv 2.7.18 + # Work-around for Stretch fw 2.7.18 if not (vendor_names := result.findall("./module/vendor_name")): result = await self._request(MODULES) vendor_names = result.findall("./module/vendor_name") @@ -395,58 +127,62 @@ async def connect(self) -> bool: # Determine smile specifics await self._smile_detect(result, dsmrmain) + self._smile_api = SmileAPI( + self._host, + self._passwd, + self._websession, + self._cooling_present, + self._elga, + self._is_thermostat, + self._last_active, + self._on_off_device, + self._opentherm_device, + self._schedule_old_states, + self.gateway_id, + self.loc_data, + self.smile_fw_version, + self.smile_hostname, + self.smile_hw_version, + self.smile_legacy, + self.smile_mac_address, + self.smile_model, + self.smile_name, + self.smile_type, + self.smile_version, + self._user, + self._port, + self._timeout, + ) + if self.smile_legacy: + self._smile_api = SmileLegacyAPI( + self._host, + self._passwd, + self._websession, + self._is_thermostat, + self._on_off_device, + self._opentherm_device, + self._stretch_v2, + self._target_smile, + self.loc_data, + self.smile_fw_version, + self.smile_hostname, + self.smile_hw_version, + self.smile_mac_address, + self.smile_model, + self.smile_name, + self.smile_type, + self.smile_version, + self.smile_zigbee_mac_address, + self._user, + self._port, + self._timeout, + ) + # Update all endpoints on first connect - await self._full_update_device() + await self._smile_api.full_update_device() return True - async def _smile_detect_legacy( - self, result: etree, dsmrmain: etree, model: str - ) -> str: - """Helper-function for _smile_detect().""" - return_model = model - # Stretch: find the MAC of the zigbee master_controller (= Stick) - if (network := result.find("./module/protocols/master_controller")) is not None: - self.smile_zigbee_mac_address = network.find("mac_address").text - # Find the active MAC in case there is an orphaned Stick - if zb_networks := result.findall("./network"): - for zb_network in zb_networks: - if zb_network.find("./nodes/network_router") is not None: - network = zb_network.find("./master_controller") - self.smile_zigbee_mac_address = network.find("mac_address").text - - # Legacy Anna or Stretch: - if ( - result.find('./appliance[type="thermostat"]') is not None - or network is not None - ): - self._system = await self._request(SYSTEM) - self.smile_fw_version = self._system.find("./gateway/firmware").text - return_model = self._system.find("./gateway/product").text - self.smile_hostname = self._system.find("./gateway/hostname").text - # If wlan0 contains data it's active, so eth0 should be checked last - for network in ("wlan0", "eth0"): - locator = f"./{network}/mac" - if (net_locator := self._system.find(locator)) is not None: - self.smile_mac_address = net_locator.text - # P1 legacy: - elif dsmrmain is not None: - self._status = await self._request(STATUS) - self.smile_fw_version = self._status.find("./system/version").text - return_model = self._status.find("./system/product").text - self.smile_hostname = self._status.find("./network/hostname").text - self.smile_mac_address = self._status.find("./network/mac_address").text - else: # pragma: no cover - # No cornercase, just end of the line - LOGGER.error( - "Connected but no gateway device information found, please create" - " an issue on http://github.com/plugwise/python-plugwise" - ) - raise ResponseError - - self._smile_legacy = True - return return_model - async def _smile_detect(self, result: etree, dsmrmain: etree) -> None: """Helper-function for connect(). @@ -496,7 +232,6 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None: if self.smile_type == "stretch": self._stretch_v2 = self.smile_version[1].major == 2 - self._stretch_v3 = self.smile_version[1].major == 3 if self.smile_type == "thermostat": self._is_thermostat = True @@ -518,119 +253,70 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None: if result.find(locator_2) is not None: self._elga = True - async def _full_update_device(self) -> None: - """Perform a first fetch of all XML data, needed for initialization.""" - self._domain_objects = await self._request(DOMAIN_OBJECTS) - self._get_plugwise_notifications() - self._locations = await self._request(LOCATIONS) - self._modules = await self._request(MODULES) - # P1 legacy has no appliances - if not (self.smile_type == "power" and self._smile_legacy): - self._appliances = await self._request(APPLIANCES) - - def _get_plugwise_notifications(self) -> None: - """Collect the Plugwise notifications.""" - self._notifications = {} - for notification in self._domain_objects.findall("./notification"): - try: - msg_id = notification.attrib["id"] - msg_type = notification.find("type").text - msg = notification.find("message").text - self._notifications.update({msg_id: {msg_type: msg}}) - LOGGER.debug("Plugwise notifications: %s", self._notifications) - except AttributeError: # pragma: no cover - LOGGER.debug( - "Plugwise notification present but unable to process, manually investigate: %s", - f"{self._endpoint}{DOMAIN_OBJECTS}", - ) + async def _smile_detect_legacy( + self, result: etree, dsmrmain: etree, model: str + ) -> str: + """Helper-function for _smile_detect().""" + return_model = model + # Stretch: find the MAC of the zigbee master_controller (= Stick) + if (network := result.find("./module/protocols/master_controller")) is not None: + self.smile_zigbee_mac_address = network.find("mac_address").text + # Find the active MAC in case there is an orphaned Stick + if zb_networks := result.findall("./network"): + for zb_network in zb_networks: + if zb_network.find("./nodes/network_router") is not None: + network = zb_network.find("./master_controller") + self.smile_zigbee_mac_address = network.find("mac_address").text - async def async_update(self) -> PlugwiseData: - """Perform an incremental update for updating the various device states.""" - # Perform a full update at day-change - day_number = dt.datetime.now().strftime("%w") + # Legacy Anna or Stretch: if ( - day_number # pylint: disable=consider-using-assignment-expr - != self._previous_day_number + result.find('./appliance[type="thermostat"]') is not None + or network is not None ): - LOGGER.debug( - "Performing daily full-update, reload the Plugwise integration when a single entity becomes unavailable." + system = await self._request(SYSTEM) + self.smile_fw_version = system.find("./gateway/firmware").text + return_model = system.find("./gateway/product").text + self.smile_hostname = system.find("./gateway/hostname").text + # If wlan0 contains data it's active, so eth0 should be checked last + for network in ("wlan0", "eth0"): + locator = f"./{network}/mac" + if (net_locator := system.find(locator)) is not None: + self.smile_mac_address = net_locator.text + # P1 legacy: + elif dsmrmain is not None: + status = await self._request(STATUS) + self.smile_fw_version = status.find("./system/version").text + return_model = status.find("./system/product").text + self.smile_hostname = status.find("./network/hostname").text + self.smile_mac_address = status.find("./network/mac_address").text + else: # pragma: no cover + # No cornercase, just end of the line + LOGGER.error( + "Connected but no gateway device information found, please create" + " an issue on http://github.com/plugwise/python-plugwise" ) - self.gw_data: GatewayData = {} - self.gw_devices: dict[str, DeviceData] = {} - await self._full_update_device() - self.get_all_devices() - # Otherwise perform an incremental update - else: - self._domain_objects = await self._request(DOMAIN_OBJECTS) - self._get_plugwise_notifications() - match self._target_smile: - case "smile_v2": - self._modules = await self._request(MODULES) - case "smile_v3" | "smile_v4": - self._locations = await self._request(LOCATIONS) - case "smile_open_therm_v2" | "smile_open_therm_v3": - self._appliances = await self._request(APPLIANCES) - self._modules = await self._request(MODULES) - case self._target_smile if self._target_smile in REQUIRE_APPLIANCES: - self._appliances = await self._request(APPLIANCES) - - self._update_gw_devices() - self.gw_data["notifications"] = self._notifications - - self._previous_day_number = day_number - return PlugwiseData(self.gw_data, self.gw_devices) - - async def _set_schedule_state_legacy( - self, loc_id: str, name: str, status: str - ) -> None: - """Helper-function for set_schedule_state().""" - schedule_rule_id: str | None = None - for rule in self._domain_objects.findall("rule"): - if rule.find("name").text == name: - schedule_rule_id = rule.attrib["id"] - - if schedule_rule_id is None: - raise PlugwiseError("Plugwise: no schedule with this name available.") - - new_state = "false" - if status == "on": - new_state = "true" - # If no state change is requested, do nothing - if new_state == self._schedule_old_states[loc_id][name]: - return - - locator = f'.//*[@id="{schedule_rule_id}"]/template' - for rule in self._domain_objects.findall(locator): - template_id = rule.attrib["id"] - - uri = f"{RULES};id={schedule_rule_id}" - data = ( - "{new_state}' - ) + raise ResponseError - await self._request(uri, method="put", data=data) - self._schedule_old_states[loc_id][name] = new_state + self.smile_legacy = True + return return_model - def determine_contexts( - self, loc_id: str, name: str, state: str, sched_id: str - ) -> etree: - """Helper-function for set_schedule_state().""" - locator = f'.//*[@id="{sched_id}"]/contexts' - contexts = self._domain_objects.find(locator) - locator = f'.//*[@id="{loc_id}"].../...' - if (subject := contexts.find(locator)) is None: - subject = f'' - subject = etree.fromstring(subject) + async def full_update_device(self) -> None: + """Perform a first fetch of all XML data, needed for initialization.""" + await self._smile_api.full_update_device() - if state == "off": - self._last_active[loc_id] = name - contexts.remove(subject) - if state == "on": - contexts.append(subject) + def get_all_devices(self) -> None: + """Determine the devices present from the obtained XML-data.""" + self._smile_api.get_all_devices() - return etree.tostring(contexts, encoding="unicode").rstrip() + async def async_update(self) -> PlugwiseData: + """Perform an incremental update for updating the various device states.""" + data: PlugwiseData = await self._smile_api.async_update() + self.gateway_id = data.gateway["gateway_id"] + return data + +######################################################################################################## +### API Set and HA Service-related Functions ### +######################################################################################################## async def set_schedule_state( self, @@ -638,280 +324,68 @@ async def set_schedule_state( new_state: str, name: str | None = None, ) -> None: - """Activate/deactivate the Schedule, with the given name, on the relevant Thermostat. - - Determined from - DOMAIN_OBJECTS. - Used in HA Core to set the hvac_mode: in practice switch between schedule on - off. - """ - # Input checking - if new_state not in ["on", "off"]: - raise PlugwiseError("Plugwise: invalid schedule state.") - - # Translate selection of Off-schedule-option to disabling the active schedule - if name == OFF: - new_state = "off" - - # Handle no schedule-name / Off-schedule provided - if name is None or name == OFF: - if schedule_name := self._last_active[loc_id]: - name = schedule_name - else: - return - - assert isinstance(name, str) - if self._smile_legacy: - await self._set_schedule_state_legacy(loc_id, name, new_state) - return - - schedule_rule = self._rule_ids_by_name(name, loc_id) - # Raise an error when the schedule name does not exist - if not schedule_rule or schedule_rule is None: - raise PlugwiseError("Plugwise: no schedule with this name available.") - - # If no state change is requested, do nothing - if new_state == self._schedule_old_states[loc_id][name]: - return - - schedule_rule_id: str = next(iter(schedule_rule)) - template = ( - '