diff --git a/CHANGELOG.md b/CHANGELOG.md index a6746c458..83dfd45b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.12.0 + +- Replace the DHW-comfort-mode switch by a DHW mode selector to match the new HA select or water_heater platform updates, via PR [#883](https://github.com/plugwise/python-plugwise/pull/883) + ## v1.11.4 - Correct Anna P1 detection via PR [#879](https://github.com/plugwise/python-plugwise/pull/879) diff --git a/fixtures/adam_bad_thermostat/data.json b/fixtures/adam_bad_thermostat/data.json index 5554c02e1..14d7d4c4d 100644 --- a/fixtures/adam_bad_thermostat/data.json +++ b/fixtures/adam_bad_thermostat/data.json @@ -7,6 +7,11 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "856285a783f24bf4b2573c8bc510eabf", "max_dhw_temperature": { "lower_bound": 0.0, @@ -31,9 +36,6 @@ "return_temperature": 33.0, "water_temperature": 20.9 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "WeHeat" }, "3ee6b9486cb04c258a3130fff2b144a4": { diff --git a/fixtures/adam_heatpump_cooling/data.json b/fixtures/adam_heatpump_cooling/data.json index 4075bf756..0102ce080 100644 --- a/fixtures/adam_heatpump_cooling/data.json +++ b/fixtures/adam_heatpump_cooling/data.json @@ -55,6 +55,11 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "comfort", + "dhw_modes": [ + "comfort", + "off" + ], "location": "eedadcb297564f1483faa509179aebed", "max_dhw_temperature": { "lower_bound": 40.0, @@ -80,9 +85,6 @@ "water_pressure": 2.0, "water_temperature": 24.5 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Remeha B.V." }, "1053c8bbf8be43c6921742b146a625f1": { diff --git a/fixtures/adam_jip/data.json b/fixtures/adam_jip/data.json index 65d256e10..bbf89908e 100644 --- a/fixtures/adam_jip/data.json +++ b/fixtures/adam_jip/data.json @@ -394,6 +394,11 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "9e4433a9d69f40b3aefd15e74395eaec", "max_dhw_temperature": { "lower_bound": 40.0, @@ -417,9 +422,6 @@ "water_pressure": 1.4, "water_temperature": 37.3 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Remeha B.V." }, "f61f1a2535f54f52ad006a3d18e459ca": { diff --git a/fixtures/adam_onoff_cooling_fake_firmware/data.json b/fixtures/adam_onoff_cooling_fake_firmware/data.json index 117954c61..c35ef647f 100644 --- a/fixtures/adam_onoff_cooling_fake_firmware/data.json +++ b/fixtures/adam_onoff_cooling_fake_firmware/data.json @@ -8,6 +8,11 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "comfort", + "dhw_modes": [ + "comfort", + "off" + ], "location": "eedadcb297564f1483faa509179aebed", "max_dhw_temperature": { "lower_bound": 40.0, @@ -31,9 +36,6 @@ "return_temperature": 24.9, "water_pressure": 2.0, "water_temperature": 24.5 - }, - "switches": { - "dhw_cm_switch": true } }, "7d97fc3117784cfdafe347bcedcbbbcb": { diff --git a/fixtures/adam_plus_anna/data.json b/fixtures/adam_plus_anna/data.json index 57d9011c1..22986758b 100644 --- a/fixtures/adam_plus_anna/data.json +++ b/fixtures/adam_plus_anna/data.json @@ -45,6 +45,10 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "07d618f0bb80412687f065b8698ce3e7", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -54,12 +58,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 48.0 - }, - "switches": { - "dhw_cm_switch": false } }, "aa6b0002df0a46e1b1eb94beb61eddfe": { diff --git a/fixtures/adam_plus_anna_new/data.json b/fixtures/adam_plus_anna_new/data.json index 0c1057afc..56c7ffbb0 100644 --- a/fixtures/adam_plus_anna_new/data.json +++ b/fixtures/adam_plus_anna_new/data.json @@ -7,6 +7,10 @@ "heating_state": true }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "bc93488efab249e5bc54fd7e175a6f91", "maximum_boiler_temperature": { "lower_bound": 25.0, @@ -16,12 +20,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 22.5, "water_temperature": 43.0 - }, - "switches": { - "dhw_cm_switch": false } }, "10016900610d4c7481df78c89606ef22": { diff --git a/fixtures/adam_plus_anna_new_regulation_off/data.json b/fixtures/adam_plus_anna_new_regulation_off/data.json index ca57a68b6..dab5f22f7 100644 --- a/fixtures/adam_plus_anna_new_regulation_off/data.json +++ b/fixtures/adam_plus_anna_new_regulation_off/data.json @@ -7,6 +7,10 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "bc93488efab249e5bc54fd7e175a6f91", "maximum_boiler_temperature": { "lower_bound": 25.0, @@ -16,12 +20,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 30.0 - }, - "switches": { - "dhw_cm_switch": false } }, "10016900610d4c7481df78c89606ef22": { diff --git a/fixtures/anna_elga_2/data.json b/fixtures/anna_elga_2/data.json index 0611a5a7c..0d25467b4 100644 --- a/fixtures/anna_elga_2/data.json +++ b/fixtures/anna_elga_2/data.json @@ -11,9 +11,14 @@ "secondary_boiler_state": true }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 58.3, @@ -23,9 +28,6 @@ "water_pressure": 0.5, "water_temperature": 42.6 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/fixtures/anna_elga_2_cooling/data.json b/fixtures/anna_elga_2_cooling/data.json index e78a5ea40..235d0bce5 100644 --- a/fixtures/anna_elga_2_cooling/data.json +++ b/fixtures/anna_elga_2_cooling/data.json @@ -11,6 +11,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -20,6 +24,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, @@ -29,9 +34,6 @@ "water_pressure": 0.5, "water_temperature": 22.8 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/fixtures/anna_elga_2_schedule_off/data.json b/fixtures/anna_elga_2_schedule_off/data.json index 3bc5f122f..1da73a1fa 100644 --- a/fixtures/anna_elga_2_schedule_off/data.json +++ b/fixtures/anna_elga_2_schedule_off/data.json @@ -11,6 +11,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -20,6 +24,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, @@ -29,9 +34,6 @@ "water_pressure": 0.5, "water_temperature": 22.8 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/fixtures/anna_elga_no_cooling/data.json b/fixtures/anna_elga_no_cooling/data.json index 9075d01e7..4a19bb86e 100644 --- a/fixtures/anna_elga_no_cooling/data.json +++ b/fixtures/anna_elga_no_cooling/data.json @@ -27,6 +27,11 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "max_dhw_temperature": { "lower_bound": 35.0, @@ -51,9 +56,6 @@ "water_pressure": 1.57, "water_temperature": 29.1 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/fixtures/anna_heatpump_cooling/data.json b/fixtures/anna_heatpump_cooling/data.json index f1bdd86fe..7c03b25d2 100644 --- a/fixtures/anna_heatpump_cooling/data.json +++ b/fixtures/anna_heatpump_cooling/data.json @@ -29,6 +29,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -38,6 +42,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "dhw_temperature": 41.5, "domestic_hot_water_setpoint": 60.0, @@ -48,9 +53,6 @@ "water_pressure": 1.61, "water_temperature": 24.7 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/data.json b/fixtures/anna_heatpump_cooling_fake_firmware/data.json index f08a11bba..e2865ce40 100644 --- a/fixtures/anna_heatpump_cooling_fake_firmware/data.json +++ b/fixtures/anna_heatpump_cooling_fake_firmware/data.json @@ -29,6 +29,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -38,6 +42,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "dhw_temperature": 41.5, "domestic_hot_water_setpoint": 60.0, @@ -48,9 +53,6 @@ "water_pressure": 1.61, "water_temperature": 24.7 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/fixtures/anna_heatpump_heating/data.json b/fixtures/anna_heatpump_heating/data.json index 2d90b6f12..54a045273 100644 --- a/fixtures/anna_heatpump_heating/data.json +++ b/fixtures/anna_heatpump_heating/data.json @@ -29,6 +29,11 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "max_dhw_temperature": { "lower_bound": 35.0, @@ -53,9 +58,6 @@ "water_pressure": 1.57, "water_temperature": 29.1 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/fixtures/anna_loria_cooling_active/data.json b/fixtures/anna_loria_cooling_active/data.json index 66b6e1940..f46113d09 100644 --- a/fixtures/anna_loria_cooling_active/data.json +++ b/fixtures/anna_loria_cooling_active/data.json @@ -71,6 +71,7 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "auto", "dhw_modes": [ "off", "auto", @@ -94,7 +95,6 @@ "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", "sensors": { "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, @@ -104,8 +104,7 @@ "water_temperature": 25.3 }, "switches": { - "cooling_ena_switch": true, - "dhw_cm_switch": true + "cooling_ena_switch": true }, "vendor": "Atlantic" } diff --git a/fixtures/anna_loria_driessens/data.json b/fixtures/anna_loria_driessens/data.json index 06f266420..31d518a8f 100644 --- a/fixtures/anna_loria_driessens/data.json +++ b/fixtures/anna_loria_driessens/data.json @@ -73,6 +73,7 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "auto", "dhw_modes": [ "comfort", "eco", @@ -96,7 +97,6 @@ "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", "sensors": { "dhw_temperature": 49.5, "intended_boiler_temperature": 0.0, @@ -106,8 +106,7 @@ "water_temperature": 23.3 }, "switches": { - "cooling_ena_switch": false, - "dhw_cm_switch": true + "cooling_ena_switch": false }, "vendor": "Atlantic" } diff --git a/fixtures/anna_loria_heating_idle/data.json b/fixtures/anna_loria_heating_idle/data.json index 62e1ca542..c13abbbcf 100644 --- a/fixtures/anna_loria_heating_idle/data.json +++ b/fixtures/anna_loria_heating_idle/data.json @@ -71,6 +71,7 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "auto", "dhw_modes": [ "off", "auto", @@ -94,7 +95,6 @@ "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", "sensors": { "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, @@ -104,8 +104,7 @@ "water_temperature": 25.3 }, "switches": { - "cooling_ena_switch": false, - "dhw_cm_switch": true + "cooling_ena_switch": false }, "vendor": "Atlantic" } diff --git a/fixtures/anna_p1/data.json b/fixtures/anna_p1/data.json index 5918dc8fb..6ee72b54c 100644 --- a/fixtures/anna_p1/data.json +++ b/fixtures/anna_p1/data.json @@ -48,19 +48,21 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "da7be222ab3b420c927f3e49fade0304", "model": "Generic heater", "model_id": "HR24", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "intended_boiler_temperature": 0.0, "modulation_level": 0.0, "water_pressure": 6.0, "water_temperature": 35.0 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Intergas" }, "53130847be2f436cb946b78dedb9053a": { diff --git a/fixtures/anna_v4/data.json b/fixtures/anna_v4/data.json index a64605171..563560b49 100644 --- a/fixtures/anna_v4/data.json +++ b/fixtures/anna_v4/data.json @@ -67,6 +67,11 @@ "heating_state": true }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "max_dhw_temperature": { "lower_bound": 30.0, @@ -90,9 +95,6 @@ "water_pressure": 2.2, "water_temperature": 45.0 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Bosch Thermotechniek B.V." } } diff --git a/fixtures/anna_v4_dhw/data.json b/fixtures/anna_v4_dhw/data.json index 677d0a622..9c1f13360 100644 --- a/fixtures/anna_v4_dhw/data.json +++ b/fixtures/anna_v4_dhw/data.json @@ -67,6 +67,11 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "max_dhw_temperature": { "lower_bound": 30.0, @@ -90,9 +95,6 @@ "water_pressure": 2.2, "water_temperature": 45.0 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Bosch Thermotechniek B.V." } } diff --git a/fixtures/anna_v4_no_tag/data.json b/fixtures/anna_v4_no_tag/data.json index 926b858e2..8fe2f6606 100644 --- a/fixtures/anna_v4_no_tag/data.json +++ b/fixtures/anna_v4_no_tag/data.json @@ -67,6 +67,11 @@ "heating_state": true }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "max_dhw_temperature": { "lower_bound": 30.0, @@ -90,9 +95,6 @@ "water_pressure": 2.2, "water_temperature": 45.0 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Bosch Thermotechniek B.V." } } diff --git a/fixtures/m_adam_cooling/data.json b/fixtures/m_adam_cooling/data.json index d1b3753ea..c5b321660 100644 --- a/fixtures/m_adam_cooling/data.json +++ b/fixtures/m_adam_cooling/data.json @@ -8,6 +8,10 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "bc93488efab249e5bc54fd7e175a6f91", "maximum_boiler_temperature": { "lower_bound": 25.0, @@ -17,12 +21,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 17.5, "water_temperature": 19.0 - }, - "switches": { - "dhw_cm_switch": false } }, "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { diff --git a/fixtures/m_adam_heating/data.json b/fixtures/m_adam_heating/data.json index 208b6df84..f29aa84c7 100644 --- a/fixtures/m_adam_heating/data.json +++ b/fixtures/m_adam_heating/data.json @@ -7,6 +7,10 @@ "heating_state": true }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "bc93488efab249e5bc54fd7e175a6f91", "max_dhw_temperature": { "lower_bound": 40.0, @@ -22,12 +26,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 38.1, "water_temperature": 37.0 - }, - "switches": { - "dhw_cm_switch": false } }, "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { diff --git a/fixtures/m_adam_heating_off_schedule/data.json b/fixtures/m_adam_heating_off_schedule/data.json index 3aeb08f30..aaabc1495 100644 --- a/fixtures/m_adam_heating_off_schedule/data.json +++ b/fixtures/m_adam_heating_off_schedule/data.json @@ -7,6 +7,10 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "bc93488efab249e5bc54fd7e175a6f91", "max_dhw_temperature": { "lower_bound": 40.0, @@ -22,12 +26,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 37.0 - }, - "switches": { - "dhw_cm_switch": false } }, "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { diff --git a/fixtures/m_adam_jip/data.json b/fixtures/m_adam_jip/data.json index a473c7748..ff33d77c2 100644 --- a/fixtures/m_adam_jip/data.json +++ b/fixtures/m_adam_jip/data.json @@ -393,6 +393,11 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "9e4433a9d69f40b3aefd15e74395eaec", "max_dhw_temperature": { "lower_bound": 40.0, @@ -416,9 +421,6 @@ "water_pressure": 1.4, "water_temperature": 37.3 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Remeha B.V." }, "f61f1a2535f54f52ad006a3d18e459ca": { diff --git a/fixtures/m_anna_heatpump_cooling/data.json b/fixtures/m_anna_heatpump_cooling/data.json index e12f137bd..fb4085270 100644 --- a/fixtures/m_anna_heatpump_cooling/data.json +++ b/fixtures/m_anna_heatpump_cooling/data.json @@ -29,6 +29,11 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "max_dhw_temperature": { "lower_bound": 35.0, @@ -53,9 +58,6 @@ "water_pressure": 1.57, "water_temperature": 22.7 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/fixtures/m_anna_heatpump_idle/data.json b/fixtures/m_anna_heatpump_idle/data.json index 5e3c3c6f3..e50349146 100644 --- a/fixtures/m_anna_heatpump_idle/data.json +++ b/fixtures/m_anna_heatpump_idle/data.json @@ -29,6 +29,11 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_mode": "off", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "max_dhw_temperature": { "lower_bound": 35.0, @@ -53,9 +58,6 @@ "water_pressure": 1.57, "water_temperature": 19.1 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/plugwise/__init__.py b/plugwise/__init__.py index efe23dfd4..fe8a9470e 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -210,10 +210,11 @@ async def _collect_smile_data( elec_point_meters = result.findall( "./location/logs/point_log/electricity_point_meter" ) - for meter in elec_point_meters: - if meter.get("id") and model == "smile_thermo": - self.smile.anna_p1 = True - break + if model == "smile_thermo": + for meter in elec_point_meters: + if meter.get("id"): + self.smile.anna_p1 = True + break else: model = await self._smile_detect_legacy(result, dsmrmain, model) @@ -422,7 +423,7 @@ async def set_temperature_offset(self, dev_id: str, offset: float) -> None: async def set_switch_state( self, appl_id: str, members: list[str] | None, model: str, state: str - ) -> bool: + ) -> bool | None: """Set the given State of the relevant Switch. Return the result: @@ -460,10 +461,14 @@ async def set_regulation_mode(self, mode: str) -> None: f"Failed to set regulation mode: {str(exc)}" ) from exc # pragma no cover - async def set_dhw_mode(self, mode: str) -> None: + async def set_dhw_mode( + self, key: str, location: str, length: int, mode: str + ) -> None: """Set the domestic hot water heating regulation mode.""" try: # pragma no cover - await self._smile_api.set_dhw_mode(mode) # pragma: no cover + await self._smile_api.set_dhw_mode( + key, location, length, mode + ) # pragma: no cover except ConnectionFailedError as exc: # pragma no cover raise ConnectionFailedError( f"Failed to set dhw mode: {str(exc)}" diff --git a/plugwise/constants.py b/plugwise/constants.py index 267f2cbdb..55e4b8e91 100644 --- a/plugwise/constants.py +++ b/plugwise/constants.py @@ -181,6 +181,7 @@ ), # Available with the Loria and Elga (newer Anna firmware) heatpumps "cooling_state": UOM(NONE), "domestic_hot_water_mode": DATA("select_dhw_mode", NONE), + "domestic_hot_water_comfort_mode": DATA("select_dhw_mode", NONE), "domestic_hot_water_setpoint": UOM(TEMP_CELSIUS), "domestic_hot_water_state": DATA("dhw_state", NONE), "domestic_hot_water_temperature": DATA("dhw_temperature", TEMP_CELSIUS), @@ -386,7 +387,6 @@ SwitchType = Literal[ "cooling_ena_switch", - "dhw_cm_switch", "lock", "relay", ] @@ -406,11 +406,6 @@ "cooling_ena_switch", "dhw_cm_switch", ] -TOGGLES: Final[dict[str, ToggleNameType]] = { - "cooling_enabled": "cooling_ena_switch", - "domestic_hot_water_comfort_mode": "dhw_cm_switch", -} - ZONE_THERMOSTATS: Final[tuple[str, ...]] = ( "thermostat", "thermostatic_radiator_valve", @@ -561,9 +556,10 @@ class GwEntityData(TypedDict, total=False): # Device availability available: bool | None - # Loria - select_dhw_mode: str + # DHW mode related + dhw_mode: str dhw_modes: list[str] + select_dhw_mode: str # Gateway gateway_modes: list[str] diff --git a/plugwise/data.py b/plugwise/data.py index eb244f0f1..3dfc293d0 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -78,6 +78,14 @@ def _update_gw_entities(self) -> None: remove_empty_platform_dicts(entity) + # Replace select_dhw_mode with dhw_mode when applicable + if ( + "max_dhw_temperature" in entity + and (mode := entity.get("select_dhw_mode")) is not None + ): + entity.pop("select_dhw_mode") + entity["dhw_mode"] = mode + def _detect_low_batteries(self) -> list[str]: """Helper-function updating the low-battery binary_sensor status from a Battery-is-low message.""" mac_address_list: list[str] = [] diff --git a/plugwise/helper.py b/plugwise/helper.py index 075f5b17d..bd7a35ca3 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -32,7 +32,6 @@ TEMP_CELSIUS, THERMO_MATCHING, THERMOSTAT_CLASSES, - TOGGLES, UOM, ZONE_MEASUREMENTS, ActuatorData, @@ -242,9 +241,8 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch appl := self._appl_heater_central_info(appl, appliance, False) ): # False means non-legacy entity return Munch() - self._dhw_allowed_modes = self._get_appl_actuator_modes( - appliance, "domestic_hot_water_mode_control_functionality" - ) + self._collect_dhw_modes(appliance) + return appl case _ as s if s.endswith("_plug"): # Collect info from plug-types (Plug, Aqara Smart Plug) @@ -265,6 +263,18 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch case _: # pragma: no cover return Munch() + def _collect_dhw_modes(self, appliance: etree.Element) -> None: + """Collect the DHW modes.""" + # Collect the Loria dhw modes + self._dhw_allowed_modes = self._get_appl_actuator_modes( + appliance, "domestic_hot_water_mode_control_functionality" + ) + # Determine the dhw modes from the domestic_hot_water_comfort_mode toggle + if not self._dhw_allowed_modes: + self._get_toggle_state( + appliance, "domestic_hot_water_comfort_mode", "dhw_cm_switch", {} + ) + def _appl_gateway_info(self, appl: Munch, appliance: etree.Element) -> Munch: """Helper-function for _appliance_info_finder().""" self._gateway_id = appl.entity_id @@ -351,7 +361,7 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: measurements = DEVICE_MEASUREMENTS if self._is_thermostat and entity_id == self.heater_id: measurements = HEATER_CENTRAL_MEASUREMENTS - # Show the allowed dhw_modes (Loria only) + # Show the available dhw_modes if self._dhw_allowed_modes: data["dhw_modes"] = self._dhw_allowed_modes # Counting of this item is done in _appliance_measurements() @@ -407,12 +417,14 @@ def _collect_appliance_data( if ( appliance := self._domain_objects.find(f'./appliance[@id="{entity_id}"]') ) is not None: + # Collect the cooling enabled toggle state + self._get_toggle_state( + appliance, "cooling_enabled", "cooling_ena_switch", data + ) + self._appliance_measurements(appliance, data, measurements) self._get_lock_state(appliance, data) - for toggle, name in TOGGLES.items(): - self._get_toggle_state(appliance, toggle, name, data) - if appliance.find("type").text in ACTUATOR_CLASSES: self._get_actuator_functionalities(appliance, entity, data) @@ -451,6 +463,7 @@ def _appliance_measurements( if skip_obsolete_measurements(appliance, measurement): continue + old_measurement = measurement if new_name := getattr(attrs, ATTR_NAME, None): measurement = new_name @@ -458,8 +471,7 @@ def _appliance_measurements( case "elga_status_code": data["elga_status_code"] = int(appl_p_loc.text) case "select_dhw_mode": - if self._dhw_allowed_modes: - data["select_dhw_mode"] = appl_p_loc.text + self._select_dhw_mode(appl_p_loc.text, data, old_measurement) common_match_cases(measurement, attrs, appl_p_loc, data) @@ -472,8 +484,19 @@ def _appliance_measurements( self._count = count_data_items(self._count, data) + def _select_dhw_mode(self, text: str, data: GwEntityData, measurement: str) -> None: + """Set the selected dhw mode.""" + if self._dhw_allowed_modes and "select_dhw_mode" not in data: + data["select_dhw_mode"] = text + if measurement == "domestic_hot_water_comfort_mode": + data["select_dhw_mode"] = "comfort" if text == "on" else "off" + def _get_toggle_state( - self, xml: etree.Element, toggle: str, name: ToggleNameType, data: GwEntityData + self, + xml: etree.Element, + toggle: str, + name: ToggleNameType, + data: GwEntityData, ) -> None: """Helper-function for _get_measurement_data(). @@ -482,8 +505,11 @@ def _get_toggle_state( if xml.find("type").text == "heater_central": locator = f"./actuator_functionalities/toggle_functionality[type='{toggle}']/state" if (state := xml.find(locator)) is not None: - data["switches"][name] = state.text == "on" - self._count += 1 + match toggle: + case "cooling_enabled": + data["switches"][name] = state.text == "on" + case "domestic_hot_water_comfort_mode": + self._dhw_allowed_modes = ["comfort", "off"] def _get_plugwise_notifications(self) -> None: """Collect the Plugwise notifications.""" diff --git a/plugwise/legacy/smile.py b/plugwise/legacy/smile.py index 89e582256..419f2fde9 100644 --- a/plugwise/legacy/smile.py +++ b/plugwise/legacy/smile.py @@ -131,7 +131,9 @@ async def delete_notification(self) -> None: async def reboot_gateway(self) -> None: """Set-function placeholder for legacy devices.""" - async def set_dhw_mode(self, mode: str) -> None: + async def set_dhw_mode( + self, key: str, location: str, length: int, mode: str + ) -> None: """Set-function placeholder for legacy devices.""" async def set_gateway_mode(self, mode: str) -> None: @@ -221,7 +223,7 @@ async def set_schedule_state( async def set_switch_state( self, appl_id: str, members: list[str] | None, model: str, state: str - ) -> bool: + ) -> bool | None: """Set the given state of the relevant switch. For individual switches, sets the state directly. @@ -229,7 +231,7 @@ async def set_switch_state( For switch-locks, sets the lock state using a different data format. Return the requested state when successful, the current state otherwise. """ - current_state = self.gw_entities[appl_id]["switches"]["relay"] + current_state = self.gw_entities[appl_id]["switches"].get("relay") requested_state = state == STATE_ON switch = Munch() switch.actuator = "actuator_functionalities" diff --git a/plugwise/smile.py b/plugwise/smile.py index 6acb4233a..40fdbc627 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -43,16 +43,15 @@ def model_to_switch_items(model: str, state: str, switch: Munch) -> tuple[str, M Helper function for set_switch_state(). """ match model: - case "dhw_cm_switch": - switch.device = "toggle" - switch.func_type = "toggle_functionality" + case "select_dhw_mode" | "dhw_mode": + switch.device = switch.func_type = "toggle" switch.act_type = "domestic_hot_water_comfort_mode" case "cooling_ena_switch": - switch.device = "toggle" - switch.func_type = "toggle_functionality" + switch.device = switch.func_type = "toggle" switch.act_type = "cooling_enabled" case "lock": switch.func = "lock" + switch.method = "post" state = "true" if state == STATE_ON else "false" return state, switch @@ -233,34 +232,51 @@ async def set_preset(self, loc_id: str, preset: str) -> None: await self.call_request(uri, method="put", data=data) async def set_select( - self, key: str, loc_id: str, option: str, state: str | None + self, key: str, appl_or_loc_id: str, option: str, state: str | None ) -> None: """Set a dhw/gateway/regulation mode or the thermostat schedule option.""" match key: - case "select_dhw_mode": - await self.set_dhw_mode(option) + case "select_dhw_mode" | "dhw_mode": + state = STATE_ON if option == "comfort" else STATE_OFF + # Appliance id is passed + await self.set_switch_state(appl_or_loc_id, None, key, state) case "select_gateway_mode": await self.set_gateway_mode(option) case "select_regulation_mode": await self.set_regulation_mode(option) case "select_schedule": - # schedule name corresponds to select option - await self.set_schedule_state(loc_id, state, option) + # The schedule name corresponds to the select option + # Location id is passed + await self.set_schedule_state(appl_or_loc_id, state, option) case "select_zone_profile": - await self.set_zone_profile(loc_id, option) + # Location id is passed + await self.set_zone_profile(appl_or_loc_id, option) - async def set_dhw_mode(self, mode: str) -> None: - """Set the domestic hot water heating regulation mode.""" + async def set_dhw_mode( + self, key: str, appl_id: str, length: int, mode: str + ) -> None: + """Set the domestic hot water mode. + + Two options are known: + - 2 modes, comfort and off, representing the dhw comfort mode on and off switch states, + - and the 5 modes available on the Loria. + """ if mode not in self._dhw_allowed_modes: raise PlugwiseError("Plugwise: invalid dhw mode.") - data = ( - "" - f"{mode}" - "" - ) - uri = f"{APPLIANCES};type=heater_central/domestic_hot_water_mode_control" - await self.call_request(uri, method="put", data=data) + match length: + case 2: + await self.set_select(key, appl_id, mode, None) + case _: + data = ( + "" + f"{mode}" + "" + ) + uri = ( + f"{APPLIANCES};type=heater_central/domestic_hot_water_mode_control" + ) + await self.call_request(uri, method="put", data=data) async def set_gateway_mode(self, mode: str) -> None: """Set the gateway mode.""" @@ -400,7 +416,7 @@ def determine_contexts(self, loc_id: str, state: str, sched_id: str) -> str: async def set_switch_state( self, appl_id: str, members: list[str] | None, model: str, state: str - ) -> bool: + ) -> bool | None: """Set the given state of the relevant Switch. For individual switches, sets the state directly. @@ -409,37 +425,34 @@ async def set_switch_state( Return the requested state when successful, the current state otherwise. """ model_type = cast(SwitchType, model) - current_state = self.gw_entities[appl_id]["switches"][model_type] + try: + current_state = self.gw_entities[appl_id]["switches"][model_type] + except KeyError: + current_state = None + requested_state = state == STATE_ON switch = Munch() switch.actuator = "actuator_functionalities" switch.device = "relay" switch.func_type = "relay_functionality" switch.func = "state" + switch.method = "put" state, switch = model_to_switch_items(model, state, switch) data = ( f"<{switch.func_type}>" f"<{switch.func}>{state}" f"" ) + extra = "" + if switch.device == "toggle": + extra = f";type={switch.act_type}" if members is not None: return await self._set_groupswitch_member_state( appl_id, data, members, state, switch ) - locator = f'appliance[@id="{appl_id}"]/{switch.actuator}/{switch.func_type}' - found = self._domain_objects.findall(locator) - for item in found: - # multiple types of e.g. toggle_functionality present - if (sw_type := item.find("type")) is not None: - if sw_type.text == switch.act_type: - switch_id = item.get("id") - break - else: # actuators with a single item like relay_functionality - switch_id = item.get("id") - - uri = f"{APPLIANCES};id={appl_id}/{switch.device};id={switch_id}" + uri = f"{APPLIANCES};id={appl_id}/{switch.device}{extra}" if model == "relay": lock_blocked = self.gw_entities[appl_id]["switches"].get("lock") if lock_blocked or lock_blocked is None: @@ -447,7 +460,7 @@ async def set_switch_state( # lock is present. That means the relay can't be controlled by the user. return current_state - await self.call_request(uri, method="put", data=data) + await self.call_request(uri, method=switch.method, data=data) return requested_state async def _set_groupswitch_member_state( @@ -462,9 +475,7 @@ async def _set_groupswitch_member_state( requested_state = state == STATE_ON switched = 0 for member in members: - locator = f'appliance[@id="{member}"]/{switch.actuator}/{switch.func_type}' - switch_id = self._domain_objects.find(locator).get("id") - uri = f"{APPLIANCES};id={member}/{switch.device};id={switch_id}" + uri = f"{APPLIANCES};id={member}/{switch.device}" lock_blocked = self.gw_entities[member]["switches"].get("lock") # Assume Plugs under Plugwise control are not part of a group if lock_blocked is not None and not lock_blocked: diff --git a/pyproject.toml b/pyproject.toml index 3333fa6f4..997b1731c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.11.4" +version = "1.12.0" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" diff --git a/tests/data/adam/adam_bad_thermostat.json b/tests/data/adam/adam_bad_thermostat.json index 5554c02e1..71b54b9a0 100644 --- a/tests/data/adam/adam_bad_thermostat.json +++ b/tests/data/adam/adam_bad_thermostat.json @@ -7,6 +7,10 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "856285a783f24bf4b2573c8bc510eabf", "max_dhw_temperature": { "lower_bound": 0.0, @@ -23,6 +27,7 @@ "model": "Generic heater", "model_id": "1.1", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "dhw_temperature": 49.9, "intended_boiler_temperature": 0.0, @@ -31,9 +36,6 @@ "return_temperature": 33.0, "water_temperature": 20.9 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "WeHeat" }, "3ee6b9486cb04c258a3130fff2b144a4": { diff --git a/tests/data/adam/adam_heatpump_cooling.json b/tests/data/adam/adam_heatpump_cooling.json index 71bfad7e2..e2401f79a 100644 --- a/tests/data/adam/adam_heatpump_cooling.json +++ b/tests/data/adam/adam_heatpump_cooling.json @@ -44,6 +44,10 @@ }, "dev_class": "heater_central", "location": "eedadcb297564f1483faa509179aebed", + "dhw_modes": [ + "comfort", + "off" + ], "max_dhw_temperature": { "lower_bound": 40.0, "resolution": 0.01, @@ -59,6 +63,7 @@ "model": "Generic heater/cooler", "model_id": "17.1", "name": "OpenTherm", + "dhw_mode": "comfort", "sensors": { "dhw_temperature": 63.5, "intended_boiler_temperature": 0.0, @@ -68,9 +73,6 @@ "water_pressure": 2.0, "water_temperature": 24.5 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Remeha B.V." }, "1053c8bbf8be43c6921742b146a625f1": { diff --git a/tests/data/adam/adam_jip.json b/tests/data/adam/adam_jip.json index a1136e3c9..7ae98246a 100644 --- a/tests/data/adam/adam_jip.json +++ b/tests/data/adam/adam_jip.json @@ -330,6 +330,10 @@ }, "dev_class": "heater_central", "location": "9e4433a9d69f40b3aefd15e74395eaec", + "dhw_modes": [ + "comfort", + "off" + ], "max_dhw_temperature": { "lower_bound": 40.0, "resolution": 0.01, @@ -345,6 +349,7 @@ "model": "Generic heater", "model_id": "10.20", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "intended_boiler_temperature": 0.0, "modulation_level": 0.0, @@ -352,9 +357,6 @@ "water_pressure": 1.4, "water_temperature": 37.3 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Remeha B.V." }, "f61f1a2535f54f52ad006a3d18e459ca": { diff --git a/tests/data/adam/adam_onoff_cooling_fake_firmware.json b/tests/data/adam/adam_onoff_cooling_fake_firmware.json index f822e33d8..c31a7710c 100644 --- a/tests/data/adam/adam_onoff_cooling_fake_firmware.json +++ b/tests/data/adam/adam_onoff_cooling_fake_firmware.json @@ -9,6 +9,10 @@ }, "dev_class": "heater_central", "location": "eedadcb297564f1483faa509179aebed", + "dhw_modes": [ + "comfort", + "off" + ], "max_dhw_temperature": { "lower_bound": 40.0, "resolution": 0.01, @@ -23,6 +27,7 @@ }, "model": "Unknown", "name": "OnOff", + "dhw_mode": "comfort", "sensors": { "dhw_temperature": 63.5, "intended_boiler_temperature": 0.0, @@ -31,9 +36,6 @@ "return_temperature": 24.9, "water_pressure": 2.0, "water_temperature": 24.5 - }, - "switches": { - "dhw_cm_switch": true } }, "7d97fc3117784cfdafe347bcedcbbbcb": { diff --git a/tests/data/adam/adam_plus_anna.json b/tests/data/adam/adam_plus_anna.json index 8533e7468..d86a53176 100644 --- a/tests/data/adam/adam_plus_anna.json +++ b/tests/data/adam/adam_plus_anna.json @@ -35,6 +35,10 @@ }, "dev_class": "heater_central", "location": "07d618f0bb80412687f065b8698ce3e7", + "dhw_modes": [ + "comfort", + "off" + ], "maximum_boiler_temperature": { "lower_bound": 0.0, "resolution": 1.0, @@ -43,12 +47,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 48.0 - }, - "switches": { - "dhw_cm_switch": false } }, "aa6b0002df0a46e1b1eb94beb61eddfe": { diff --git a/tests/data/adam/adam_plus_anna_new.json b/tests/data/adam/adam_plus_anna_new.json index 0c1057afc..d794d51cd 100644 --- a/tests/data/adam/adam_plus_anna_new.json +++ b/tests/data/adam/adam_plus_anna_new.json @@ -8,6 +8,10 @@ }, "dev_class": "heater_central", "location": "bc93488efab249e5bc54fd7e175a6f91", + "dhw_modes": [ + "comfort", + "off" + ], "maximum_boiler_temperature": { "lower_bound": 25.0, "resolution": 0.01, @@ -16,12 +20,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 22.5, "water_temperature": 43.0 - }, - "switches": { - "dhw_cm_switch": false } }, "10016900610d4c7481df78c89606ef22": { diff --git a/tests/data/adam/adam_plus_anna_new_regulation_off.json b/tests/data/adam/adam_plus_anna_new_regulation_off.json index 4a0576d90..4f3130c05 100644 --- a/tests/data/adam/adam_plus_anna_new_regulation_off.json +++ b/tests/data/adam/adam_plus_anna_new_regulation_off.json @@ -8,6 +8,10 @@ }, "dev_class": "heater_central", "location": "bc93488efab249e5bc54fd7e175a6f91", + "dhw_modes": [ + "comfort", + "off" + ], "maximum_boiler_temperature": { "lower_bound": 25.0, "resolution": 0.01, @@ -16,12 +20,10 @@ }, "model": "Generic heater", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "intended_boiler_temperature": 0.0, "water_temperature": 30.0 - }, - "switches": { - "dhw_cm_switch": false } }, "10016900610d4c7481df78c89606ef22": { diff --git a/tests/data/anna/anna_elga_2.json b/tests/data/anna/anna_elga_2.json index e417927a2..d2efd669e 100644 --- a/tests/data/anna/anna_elga_2.json +++ b/tests/data/anna/anna_elga_2.json @@ -11,9 +11,14 @@ "secondary_boiler_state": true }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 58.3, @@ -23,9 +28,6 @@ "water_pressure": 0.5, "water_temperature": 42.6 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/tests/data/anna/anna_elga_2_cooling.json b/tests/data/anna/anna_elga_2_cooling.json index 0c417702b..1910f9e8c 100644 --- a/tests/data/anna/anna_elga_2_cooling.json +++ b/tests/data/anna/anna_elga_2_cooling.json @@ -11,6 +11,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -20,6 +24,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, @@ -29,9 +34,6 @@ "water_pressure": 0.5, "water_temperature": 22.8 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/tests/data/anna/anna_elga_2_cooling_UPDATED_DATA.json b/tests/data/anna/anna_elga_2_cooling_UPDATED_DATA.json index e4dcbd958..446c24759 100644 --- a/tests/data/anna/anna_elga_2_cooling_UPDATED_DATA.json +++ b/tests/data/anna/anna_elga_2_cooling_UPDATED_DATA.json @@ -11,6 +11,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -20,6 +24,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, @@ -29,9 +34,6 @@ "water_pressure": 0.5, "water_temperature": 22.8 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/tests/data/anna/anna_elga_2_schedule_off.json b/tests/data/anna/anna_elga_2_schedule_off.json index 064a483d8..0fa003651 100644 --- a/tests/data/anna/anna_elga_2_schedule_off.json +++ b/tests/data/anna/anna_elga_2_schedule_off.json @@ -11,6 +11,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "d34dfe6ab90b410c98068e75de3eb631", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -20,6 +24,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "domestic_hot_water_setpoint": 60.0, "intended_boiler_temperature": 0.0, @@ -29,9 +34,6 @@ "water_pressure": 0.5, "water_temperature": 22.8 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Techneco" }, "ebd90df1ab334565b5895f37590ccff4": { diff --git a/tests/data/anna/anna_elga_no_cooling.json b/tests/data/anna/anna_elga_no_cooling.json index 23ec151d4..4bb9b040c 100644 --- a/tests/data/anna/anna_elga_no_cooling.json +++ b/tests/data/anna/anna_elga_no_cooling.json @@ -27,6 +27,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "max_dhw_temperature": { "lower_bound": 35.0, @@ -42,6 +46,7 @@ }, "model": "Generic heater", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "dhw_temperature": 46.3, "intended_boiler_temperature": 35.0, @@ -51,9 +56,6 @@ "water_pressure": 1.57, "water_temperature": 29.1 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/tests/data/anna/anna_heatpump_cooling.json b/tests/data/anna/anna_heatpump_cooling.json index c722045a2..abdea92dc 100644 --- a/tests/data/anna/anna_heatpump_cooling.json +++ b/tests/data/anna/anna_heatpump_cooling.json @@ -29,6 +29,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -38,6 +42,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "dhw_temperature": 41.5, "domestic_hot_water_setpoint": 60.0, @@ -48,9 +53,6 @@ "water_pressure": 1.61, "water_temperature": 24.7 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/tests/data/anna/anna_heatpump_cooling_fake_firmware.json b/tests/data/anna/anna_heatpump_cooling_fake_firmware.json index 4218240cb..77eaab4e1 100644 --- a/tests/data/anna/anna_heatpump_cooling_fake_firmware.json +++ b/tests/data/anna/anna_heatpump_cooling_fake_firmware.json @@ -29,6 +29,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "maximum_boiler_temperature": { "lower_bound": 0.0, @@ -38,6 +42,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "select_dhw_mode": "off", "sensors": { "dhw_temperature": 41.5, "domestic_hot_water_setpoint": 60.0, @@ -48,9 +53,6 @@ "water_pressure": 1.61, "water_temperature": 24.7 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/tests/data/anna/anna_heatpump_heating.json b/tests/data/anna/anna_heatpump_heating.json index ab6bdf08e..d38345a3a 100644 --- a/tests/data/anna/anna_heatpump_heating.json +++ b/tests/data/anna/anna_heatpump_heating.json @@ -29,6 +29,10 @@ "secondary_boiler_state": false }, "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "max_dhw_temperature": { "lower_bound": 35.0, @@ -44,6 +48,7 @@ }, "model": "Generic heater/cooler", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "dhw_temperature": 46.3, "intended_boiler_temperature": 35.0, @@ -53,9 +58,6 @@ "water_pressure": 1.57, "water_temperature": 29.1 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { diff --git a/tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json b/tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json index a36012587..bb8c9aac8 100644 --- a/tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json +++ b/tests/data/anna/anna_heatpump_heating_UPDATED_DATA.json @@ -1,6 +1,10 @@ { "1cbf783bb11e4a7c8a6843dee3a86927": { "dev_class": "heater_central", + "dhw_modes": [ + "comfort", + "off" + ], "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", @@ -21,6 +25,7 @@ "secondary_boiler_state": false, "flame_state": false }, + "select_dhw_mode": "off", "sensors": { "water_temperature": 29.1, "domestic_hot_water_setpoint": 60.0, @@ -30,9 +35,7 @@ "return_temperature": 25.1, "water_pressure": 1.57, "outdoor_air_temperature": 3.0 - }, - "switches": { - "dhw_cm_switch": false + } } } diff --git a/tests/data/anna/anna_loria_cooling_active.json b/tests/data/anna/anna_loria_cooling_active.json index 8b6c7341e..1dcb2e851 100644 --- a/tests/data/anna/anna_loria_cooling_active.json +++ b/tests/data/anna/anna_loria_cooling_active.json @@ -78,7 +78,7 @@ "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", + "dhw_mode": "auto", "sensors": { "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, @@ -88,8 +88,7 @@ "water_temperature": 25.3 }, "switches": { - "cooling_ena_switch": true, - "dhw_cm_switch": true + "cooling_ena_switch": true }, "vendor": "Atlantic" } diff --git a/tests/data/anna/anna_loria_driessens.json b/tests/data/anna/anna_loria_driessens.json index 2519d1f45..3d665c289 100644 --- a/tests/data/anna/anna_loria_driessens.json +++ b/tests/data/anna/anna_loria_driessens.json @@ -84,7 +84,7 @@ "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", + "dhw_mode": "auto", "sensors": { "dhw_temperature": 49.5, "intended_boiler_temperature": 0.0, @@ -94,8 +94,7 @@ "water_temperature": 23.3 }, "switches": { - "cooling_ena_switch": false, - "dhw_cm_switch": true + "cooling_ena_switch": false }, "vendor": "Atlantic" } diff --git a/tests/data/anna/anna_loria_heating_idle.json b/tests/data/anna/anna_loria_heating_idle.json index d1b640345..628515d57 100644 --- a/tests/data/anna/anna_loria_heating_idle.json +++ b/tests/data/anna/anna_loria_heating_idle.json @@ -78,7 +78,7 @@ "model": "Generic heater/cooler", "model_id": "173", "name": "OpenTherm", - "select_dhw_mode": "auto", + "dhw_mode": "auto", "sensors": { "dhw_temperature": 52.9, "intended_boiler_temperature": 0.0, @@ -88,8 +88,7 @@ "water_temperature": 25.3 }, "switches": { - "cooling_ena_switch": false, - "dhw_cm_switch": true + "cooling_ena_switch": false }, "vendor": "Atlantic" } diff --git a/tests/data/anna/anna_p1.json b/tests/data/anna/anna_p1.json index 2d09ad41f..4afa66135 100644 --- a/tests/data/anna/anna_p1.json +++ b/tests/data/anna/anna_p1.json @@ -39,19 +39,18 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": ["comfort", "off"], "location": "da7be222ab3b420c927f3e49fade0304", "model": "Generic heater", "model_id": "HR24", "name": "OpenTherm", + "select_dhw_mode": "comfort", "sensors": { "intended_boiler_temperature": 0.0, "modulation_level": 0.0, "water_pressure": 6.0, "water_temperature": 35.0 }, - "switches": { - "dhw_cm_switch": true - }, "vendor": "Intergas" }, "da7be222ab3b420c927f3e49fade0304": { diff --git a/tests/data/anna/anna_v4.json b/tests/data/anna/anna_v4.json index 7e6f138be..09f295bad 100644 --- a/tests/data/anna/anna_v4.json +++ b/tests/data/anna/anna_v4.json @@ -57,6 +57,7 @@ "heating_state": true }, "dev_class": "heater_central", + "dhw_modes": ["comfort", "off"], "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "max_dhw_temperature": { "lower_bound": 30.0, @@ -73,6 +74,7 @@ "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "intended_boiler_temperature": 39.9, "modulation_level": 0.0, @@ -80,9 +82,6 @@ "water_pressure": 2.2, "water_temperature": 45.0 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Bosch Thermotechniek B.V." } } diff --git a/tests/data/anna/anna_v4_UPDATED_DATA.json b/tests/data/anna/anna_v4_UPDATED_DATA.json index 0d0fde7af..e36a6e5b1 100644 --- a/tests/data/anna/anna_v4_UPDATED_DATA.json +++ b/tests/data/anna/anna_v4_UPDATED_DATA.json @@ -1,5 +1,6 @@ { "cd0e6156b1f04d5f952349ffbe397481": { + "dhw_modes": ["comfort", "off"], "maximum_boiler_temperature": { "setpoint": 69.0, "lower_bound": 0.0, @@ -17,15 +18,13 @@ "heating_state": false, "flame_state": false }, + "dhw_mode": "comfort", "sensors": { "water_temperature": 51.0, "intended_boiler_temperature": 0.0, "modulation_level": 0, "return_temperature": 41.0, "water_pressure": 2.1 - }, - "switches": { - "dhw_cm_switch": true } }, "01b85360fdd243d0aaad4d6ac2a5ba7e": { diff --git a/tests/data/anna/anna_v4_dhw.json b/tests/data/anna/anna_v4_dhw.json index a560de161..dc8ba3858 100644 --- a/tests/data/anna/anna_v4_dhw.json +++ b/tests/data/anna/anna_v4_dhw.json @@ -57,6 +57,7 @@ "heating_state": false }, "dev_class": "heater_central", + "dhw_modes": ["comfort", "off"], "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "max_dhw_temperature": { "lower_bound": 30.0, @@ -73,6 +74,7 @@ "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "intended_boiler_temperature": 39.9, "modulation_level": 0.0, @@ -80,9 +82,6 @@ "water_pressure": 2.2, "water_temperature": 45.0 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Bosch Thermotechniek B.V." } } diff --git a/tests/data/anna/anna_v4_no_tag.json b/tests/data/anna/anna_v4_no_tag.json index 513e7ce20..d9a500cfc 100644 --- a/tests/data/anna/anna_v4_no_tag.json +++ b/tests/data/anna/anna_v4_no_tag.json @@ -57,6 +57,7 @@ "heating_state": true }, "dev_class": "heater_central", + "dhw_modes": ["comfort", "off"], "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "max_dhw_temperature": { "lower_bound": 30.0, @@ -73,6 +74,7 @@ "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", + "dhw_mode": "off", "sensors": { "intended_boiler_temperature": 39.9, "modulation_level": 0.0, @@ -80,9 +82,6 @@ "water_pressure": 2.2, "water_temperature": 45.0 }, - "switches": { - "dhw_cm_switch": false - }, "vendor": "Bosch Thermotechniek B.V." } } diff --git a/tests/test_adam.py b/tests/test_adam.py index b818713f1..1ef525961 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -47,7 +47,7 @@ async def test_connect_adam_plus_anna_new(self): test_items = await self.device_test(api, "2025-10-12 00:00:01", testdata) assert api.gateway_id == "da224107914542988a88561b4452b0f6" - assert self.entity_items == 231 + assert self.entity_items == 232 assert test_items == self.entity_items assert self.entity_list == [ "da224107914542988a88561b4452b0f6", @@ -115,12 +115,6 @@ async def test_connect_adam_plus_anna_new(self): ["2568cc4b9c1e401495d4741a5f89bee1", "29542b2b6a6a4169acecc15c72a599b8"], ) assert switch_change - switch_change = await self.tinker_switch( - api, - "056ee145a816487eaa69243c3280f8bf", - model="dhw_cm_switch", - ) - assert switch_change # Test relay without lock-attribute switch_change = await self.tinker_switch( api, @@ -144,6 +138,11 @@ async def test_connect_adam_plus_anna_new(self): "854f8a9b0e7e425db97f1f110e1ce4b3", ) + tinkered = await self.tinker_dhw_mode( + api, "056ee145a816487eaa69243c3280f8bf", "select_dhw_mode", 2 + ) + assert not tinkered + tinkered = await self.tinker_gateway_mode(api) assert not tinkered @@ -352,7 +351,7 @@ async def test_adam_heatpump_cooling(self): server, api, client = await self.connect_wrapper() test_items = await self.device_test(api, "2022-01-02 00:00:01", testdata) - assert self.entity_items == 539 + assert self.entity_items == 540 assert test_items == self.entity_items assert self.cooling_present assert self._cooling_enabled @@ -376,7 +375,7 @@ async def test_connect_adam_onoff_cooling_fake_firmware(self): ) test_items = await self.device_test(api, "2022-01-02 00:00:01", testdata) - assert self.entity_items == 70 + assert self.entity_items == 71 assert test_items == self.entity_items assert self.cooling_present # assert self._cooling_enabled - no cooling_enabled indication present @@ -401,7 +400,7 @@ async def test_connect_adam_plus_anna(self): test_items = await self.device_test(api, "2020-03-22 00:00:01", testdata) assert api.gateway_id == "b128b4bbbd1f47e9bf4d756e8fb5ee94" - assert self.entity_items == 82 + assert self.entity_items == 83 assert test_items == self.entity_items assert "6fb89e35caeb4b1cb275184895202d84" in self.notifications @@ -442,7 +441,7 @@ async def test_adam_plus_jip(self): test_items = await self.device_test(api, "2021-06-20 00:00:01", testdata) assert api.gateway_id == "b5c2386c6f6342669e50fe49dd05b188" - assert self.entity_items == 269 + assert self.entity_items == 270 assert test_items == self.entity_items # Negative test @@ -461,5 +460,11 @@ async def test_adam_plus_jip(self): good_schedules=[None], ) assert result + + tinkered = await self.tinker_dhw_mode( + api, "e4684553153b44afbef2200885f379dc", "dhw_mode", 2 + ) + assert not tinkered + await api.close_connection() await self.disconnect(server, client) diff --git a/tests/test_anna.py b/tests/test_anna.py index 84fbcf27a..464d2e277 100644 --- a/tests/test_anna.py +++ b/tests/test_anna.py @@ -29,7 +29,7 @@ async def test_connect_anna_v4(self): await self.device_test(api, "2020-04-05 00:00:01", testdata) assert api.gateway_id == "0466eae8520144c78afb29628384edeb" - assert self.entity_items == 60 + assert self.entity_items == 61 assert not self.notifications assert not self.cooling_present @@ -101,7 +101,7 @@ async def test_connect_anna_v4_dhw(self): ) await self.device_test(api, "2020-04-05 00:00:01", testdata) - assert self.entity_items == 60 + assert self.entity_items == 61 assert not self.notifications result = await self.tinker_thermostat( @@ -130,7 +130,7 @@ async def test_connect_anna_v4_no_tag(self): ) await self.device_test(api, "2020-04-05 00:00:01", testdata) - assert self.entity_items == 60 + assert self.entity_items == 61 result = await self.tinker_thermostat( api, @@ -186,7 +186,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test(api, "2020-04-12 00:00:01", testdata) assert api.gateway_id == "015ae9ea3f964e668e490fa39da3870b" - assert self.entity_items == 69 + assert self.entity_items == 70 assert not self.notifications assert self.cooling_present assert not self._cooling_enabled @@ -216,7 +216,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test( api, "2020-04-13 00:00:01", testdata_updated, initialize=False ) - assert self.entity_items == 66 + assert self.entity_items == 67 await api.close_connection() await self.disconnect(server, client) @@ -241,7 +241,7 @@ async def test_connect_anna_heatpump_cooling(self): ) await self.device_test(api, "2020-04-19 00:00:01", testdata) - assert self.entity_items == 66 + assert self.entity_items == 67 assert self.cooling_present assert not self.notifications @@ -287,7 +287,7 @@ async def test_connect_anna_heatpump_cooling_fake_firmware(self): ) await self.device_test(api, "2020-04-19 00:00:01", testdata) - assert self.entity_items == 66 + assert self.entity_items == 67 assert self.cooling_present assert self._cooling_enabled assert self._cooling_active @@ -313,7 +313,7 @@ async def test_connect_anna_elga_no_cooling(self): await self.device_test(api, "2020-04-12 00:00:01", testdata) assert api.gateway_id == "015ae9ea3f964e668e490fa39da3870b" - assert self.entity_items == 65 + assert self.entity_items == 66 assert not self.notifications assert not self.cooling_present @@ -336,7 +336,7 @@ async def test_connect_anna_elga_2(self): ) await self.device_test(api, "2022-03-13 00:00:01", testdata) - assert self.entity_items == 61 + assert self.entity_items == 62 assert api.gateway_id == "fb49af122f6e4b0f91267e1cf7666d6f" assert self.cooling_present assert not self._cooling_enabled @@ -356,7 +356,7 @@ async def test_connect_anna_elga_2_schedule_off(self): await self.device_test(api, "2022-03-13 00:00:01", testdata) assert not self._cooling_enabled - assert self.entity_items == 65 + assert self.entity_items == 66 result = await self.tinker_thermostat( api, @@ -387,7 +387,7 @@ async def test_connect_anna_elga_2_cooling(self): ) await self.device_test(api, "2022-03-10 00:00:01", testdata) - assert self.entity_items == 65 + assert self.entity_items == 66 assert not self.notifications assert self.cooling_present @@ -440,7 +440,7 @@ async def test_connect_anna_loria_heating_idle(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 68 + assert self.entity_items == 67 assert self.cooling_present assert not self._cooling_enabled @@ -474,7 +474,9 @@ async def test_connect_anna_loria_heating_idle(self): "ERROR raised setting block cooling: %s", exc.value ) # pragma: no cover - tinkered = await self.tinker_dhw_mode(api) + tinkered = await self.tinker_dhw_mode( + api, "bfb5ee0a88e14e5f97bfa725a760cc49", "dhw_mode", 5 + ) assert not tinkered await api.close_connection() @@ -483,7 +485,9 @@ async def test_connect_anna_loria_heating_idle(self): server, api, client = await self.connect_wrapper(raise_timeout=True) await self.device_test(api, "2022-05-16 00:00:01", testdata, skip_testing=True) - tinkered = await self.tinker_dhw_mode(api, unhappy=True) + tinkered = await self.tinker_dhw_mode( + api, "bfb5ee0a88e14e5f97bfa725a760cc49", "dhw_mode", 4, unhappy=True + ) assert tinkered await api.close_connection() @@ -505,7 +509,7 @@ async def test_connect_anna_loria_cooling_active(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 68 + assert self.entity_items == 67 assert self.cooling_present assert self._cooling_enabled @@ -528,7 +532,7 @@ async def test_connect_anna_loria_driessens(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 68 + assert self.entity_items == 67 assert self.cooling_present assert not self._cooling_enabled @@ -551,7 +555,7 @@ async def test_connect_anna_p1(self): ) await self.device_test(api, "2025-11-02 00:00:01", testdata) - assert self.entity_items == 76 + assert self.entity_items == 77 await api.close_connection() await self.disconnect(server, client) diff --git a/tests/test_init.py b/tests/test_init.py index 1f8f3c803..db3790005 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -115,22 +115,23 @@ def setup_app( # Introducte timeout with 2 seconds, test by setting response to 10ms # Don't actually wait 2 seconds as this will prolongue testing if not raise_timeout: + app.router.add_route("POST", CORE_APPLIANCES_TAIL, self.smile_http_accept) + app.router.add_route("PUT", CORE_APPLIANCES_TAIL, self.smile_http_accept) app.router.add_route("POST", CORE_GATEWAYS_TAIL, self.smile_http_accept) - app.router.add_route("PUT", CORE_LOCATIONS_TAIL, self.smile_http_accept) app.router.add_route("POST", CORE_LOCATIONS_TAIL, self.smile_http_accept) + app.router.add_route("PUT", CORE_LOCATIONS_TAIL, self.smile_http_accept) app.router.add_route( "DELETE", CORE_NOTIFICATIONS_TAIL, self.smile_http_accept ) app.router.add_route("PUT", CORE_RULES_TAIL, self.smile_http_accept) - app.router.add_route("PUT", CORE_APPLIANCES_TAIL, self.smile_http_accept) else: + app.router.add_route("POST", CORE_APPLIANCES_TAIL, self.smile_timeout) + app.router.add_route("PUT", CORE_APPLIANCES_TAIL, self.smile_timeout) app.router.add_route("POST", CORE_GATEWAYS_TAIL, self.smile_timeout) - app.router.add_route("PUT", CORE_LOCATIONS_TAIL, self.smile_timeout) app.router.add_route("POST", CORE_LOCATIONS_TAIL, self.smile_timeout) - app.router.add_route("PUT", CORE_RULES_TAIL, self.smile_timeout) - app.router.add_route("PUT", CORE_APPLIANCES_TAIL, self.smile_timeout) + app.router.add_route("PUT", CORE_LOCATIONS_TAIL, self.smile_timeout) app.router.add_route("DELETE", CORE_NOTIFICATIONS_TAIL, self.smile_timeout) - + app.router.add_route("PUT", CORE_RULES_TAIL, self.smile_timeout) return app def setup_legacy_app( @@ -849,17 +850,17 @@ async def tinker_legacy_thermostat( return result_1 and result_2 and result_3 @staticmethod - async def tinker_dhw_mode(api, unhappy=False): + async def tinker_dhw_mode(api, appliance, key, length, unhappy=False): """Toggle dhw to test functionality.""" tinker_dhw_mode_passed = False - for mode in ["auto", "boost", BOGUS]: + for mode in ["off", "comfort", "auto", BOGUS]: warning = "" if mode[0] == "!": warning = " TD Negative test" mode = mode[1:] _LOGGER.info("%s", f"- Adjusting dhw mode to {mode}{warning}") try: - await api.set_select("select_dhw_mode", "dummy", mode) + await api.set_dhw_mode(key, appliance, length, mode) _LOGGER.info(" + tinker_dhw_mode worked as intended") tinker_dhw_mode_passed = True except pw_exceptions.PlugwiseError: