diff --git a/CHANGELOG.md b/CHANGELOG.md index f1adbbc73..3833b9eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Versions from 0.40 and up +## v0.54.2 + +- Link to plugwise [v1.5.1](https://github.com/plugwise/python-plugwise/releases/tag/v1.5.1) and adapt: + - Change thermostat device-key `mode` to `climate_mode` + ## v0.54.1 - Fix typing error diff --git a/custom_components/plugwise/climate.py b/custom_components/plugwise/climate.py index caa27803b..4d0a1c786 100644 --- a/custom_components/plugwise/climate.py +++ b/custom_components/plugwise/climate.py @@ -31,6 +31,7 @@ ACTIVE_PRESET, AVAILABLE_SCHEDULES, BINARY_SENSORS, + CLIMATE_MODE, CONF_HOMEKIT_EMULATION, # pw-beta homekit emulation CONTROL_STATE, COOLING_PRESENT, @@ -43,7 +44,6 @@ LOGGER, LOWER_BOUND, MASTER_THERMOSTATS, - MODE, REGULATION_MODES, RESOLUTION, SELECT_REGULATION_MODE, @@ -195,7 +195,7 @@ def target_temperature_low(self) -> float: def hvac_mode(self) -> HVACMode: """Return HVAC operation ie. auto, cool, heat, heat_cool, or off mode.""" if ( - mode := self.device[MODE] + mode := self.device[CLIMATE_MODE] ) is None or mode not in self.hvac_modes: # pw-beta add to Core return HVACMode.HEAT # pragma: no cover # pw-beta homekit emulation diff --git a/custom_components/plugwise/const.py b/custom_components/plugwise/const.py index 7897d4a08..df5a1b725 100644 --- a/custom_components/plugwise/const.py +++ b/custom_components/plugwise/const.py @@ -43,11 +43,11 @@ # Climate constants ACTIVE_PRESET: Final = "active_preset" +CLIMATE_MODE: Final = "climate_mode" CONTROL_STATE: Final = "control_state" COOLING_PRESENT: Final ="cooling_present" DEV_CLASS: Final = "dev_class" NONE : Final = "None" -MODE: Final = "mode" TARGET_TEMP: Final = "setpoint" TARGET_TEMP_HIGH: Final = "setpoint_high" TARGET_TEMP_LOW: Final = "setpoint_low" diff --git a/custom_components/plugwise/manifest.json b/custom_components/plugwise/manifest.json index f2a3f45ac..8d8a4ccce 100644 --- a/custom_components/plugwise/manifest.json +++ b/custom_components/plugwise/manifest.json @@ -7,7 +7,7 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["plugwise"], - "requirements": ["plugwise==1.5.0"], - "version": "0.54.1", + "requirements": ["plugwise==1.5.1"], + "version": "0.54.2", "zeroconf": ["_plugwise._tcp.local."] } diff --git a/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json b/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json index b324a99e7..66b02931f 100644 --- a/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json +++ b/tests/components/plugwise/fixtures/anna_heatpump_heating/all_data.json @@ -64,11 +64,11 @@ "standaard", "off" ], + "climate_mode": "auto", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", - "mode": "auto", "model": "ThermoTouch", "name": "Anna", "preset_modes": [ diff --git a/tests/components/plugwise/fixtures/legacy_anna/all_data.json b/tests/components/plugwise/fixtures/legacy_anna/all_data.json index 71452119e..2b0a27182 100644 --- a/tests/components/plugwise/fixtures/legacy_anna/all_data.json +++ b/tests/components/plugwise/fixtures/legacy_anna/all_data.json @@ -36,11 +36,11 @@ }, "0d266432d64443e283b5d708ae98b455": { "active_preset": "home", + "climate_mode": "heat", "dev_class": "thermostat", "firmware": "2017-03-13T11:54:58+01:00", "hardware": "6539-1301-500", "location": "0000aaaa0000aaaa0000aaaa0000aa00", - "mode": "heat", "model": "ThermoTouch", "name": "Anna", "preset_modes": [ @@ -51,7 +51,7 @@ "no_frost" ], "sensors": { - "illuminance": 151, + "illuminance": 150.8, "setpoint": 20.5, "temperature": 20.4 }, diff --git a/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json b/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json index 1a829d236..ffda247bb 100644 --- a/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json @@ -63,10 +63,10 @@ "Weekschema", "off" ], + "climate_mode": "cool", "control_state": "cooling", "dev_class": "thermostat", "location": "f2bf9048bef64cc5b6d5110154e33c81", - "mode": "cool", "model": "ThermoTouch", "model_id": "143.1", "name": "Anna", @@ -135,12 +135,12 @@ "binary_sensors": { "low_battery": true }, + "climate_mode": "auto", "control_state": "preheating", "dev_class": "zone_thermostat", "firmware": "2016-10-10T02:00:00+02:00", "hardware": "255", "location": "f871b8c4d63549319221e294e4f88074", - "mode": "auto", "model": "Lisa", "model_id": "158-01", "name": "Lisa Badkamer", diff --git a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json index 066661217..bc7fee930 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json @@ -68,10 +68,10 @@ "Weekschema", "off" ], + "climate_mode": "heat", "control_state": "preheating", "dev_class": "thermostat", "location": "f2bf9048bef64cc5b6d5110154e33c81", - "mode": "heat", "model": "ThermoTouch", "model_id": "143.1", "name": "Anna", @@ -139,12 +139,12 @@ "binary_sensors": { "low_battery": true }, + "climate_mode": "auto", "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-10T02:00:00+02:00", "hardware": "255", "location": "f871b8c4d63549319221e294e4f88074", - "mode": "auto", "model": "Lisa", "model_id": "158-01", "name": "Lisa Badkamer", diff --git a/tests/components/plugwise/fixtures/m_adam_jip/all_data.json b/tests/components/plugwise/fixtures/m_adam_jip/all_data.json index 811db5db2..569525975 100644 --- a/tests/components/plugwise/fixtures/m_adam_jip/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_jip/all_data.json @@ -6,12 +6,12 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "off", "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "06aecb3d00354375924f50c47af36bd2", - "mode": "off", "model": "Lisa", "model_id": "158-01", "name": "Slaapkamer", @@ -113,12 +113,12 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "heat", "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "d27aede973b54be484f6842d1b2802ad", - "mode": "heat", "model": "Lisa", "model_id": "158-01", "name": "Kinderkamer", @@ -179,12 +179,12 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "heat", "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "d58fec52899f4f1c92e4f8fad6d8c48c", - "mode": "heat", "model": "Lisa", "model_id": "158-01", "name": "Logeerkamer", @@ -312,12 +312,12 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "heat", "control_state": "off", "dev_class": "zone_thermometer", "firmware": "2020-09-01T02:00:00+02:00", "hardware": "1", "location": "13228dab8ce04617af318a2888b3c548", - "mode": "heat", "model": "Jip", "model_id": "168-01", "name": "Woonkamer", diff --git a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json index 8789b8957..290935ac4 100644 --- a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json @@ -126,11 +126,11 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "auto", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "82fa13f017d240daa0d0ea1775420f24", - "mode": "auto", "model": "Lisa", "model_id": "158-01", "name": "Zone Thermostat Jessie", @@ -283,11 +283,11 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "auto", "dev_class": "zone_thermostat", "firmware": "2016-08-02T02:00:00+02:00", "hardware": "255", "location": "c50f167537524366a5af7aa3942feb1e", - "mode": "auto", "model": "Lisa", "model_id": "158-01", "name": "Zone Lisa WK", @@ -382,11 +382,11 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "heat", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "12493538af164a409c6a1c79e38afe1c", - "mode": "heat", "model": "Lisa", "model_id": "158-01", "name": "Zone Lisa Bios", @@ -424,11 +424,11 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "heat", "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "446ac08dd04d4eff8ac57489757b7314", - "mode": "heat", "model": "Tom/Floor", "model_id": "106-03", "name": "CV Kraan Garage", @@ -475,11 +475,11 @@ "binary_sensors": { "low_battery": false }, + "climate_mode": "auto", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "08963fec7c53423ca5680aa4cb502c63", - "mode": "auto", "model": "Lisa", "model_id": "158-01", "name": "Zone Thermostat Badkamer", diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json index 455190f90..044de1244 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/all_data.json @@ -64,11 +64,11 @@ "standaard", "off" ], + "climate_mode": "auto", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", - "mode": "auto", "model": "ThermoTouch", "name": "Anna", "preset_modes": [ diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json index 95fe17eb4..bc33ac339 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_idle/all_data.json @@ -64,11 +64,11 @@ "standaard", "off" ], + "climate_mode": "auto", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", - "mode": "auto", "model": "ThermoTouch", "name": "Anna", "preset_modes": [ diff --git a/tests/components/plugwise/snapshots/test_diagnostics.ambr b/tests/components/plugwise/snapshots/test_diagnostics.ambr index d187e0355..2a8223a25 100644 --- a/tests/components/plugwise/snapshots/test_diagnostics.ambr +++ b/tests/components/plugwise/snapshots/test_diagnostics.ambr @@ -128,11 +128,11 @@ 'binary_sensors': dict({ 'low_battery': False, }), + 'climate_mode': 'auto', 'dev_class': 'zone_thermostat', 'firmware': '2016-10-27T02:00:00+02:00', 'hardware': '255', 'location': '82fa13f017d240daa0d0ea1775420f24', - 'mode': 'auto', 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Thermostat Jessie', @@ -285,11 +285,11 @@ 'binary_sensors': dict({ 'low_battery': False, }), + 'climate_mode': 'auto', 'dev_class': 'zone_thermostat', 'firmware': '2016-08-02T02:00:00+02:00', 'hardware': '255', 'location': 'c50f167537524366a5af7aa3942feb1e', - 'mode': 'auto', 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Lisa WK', @@ -384,11 +384,11 @@ 'binary_sensors': dict({ 'low_battery': False, }), + 'climate_mode': 'heat', 'dev_class': 'zone_thermostat', 'firmware': '2016-10-27T02:00:00+02:00', 'hardware': '255', 'location': '12493538af164a409c6a1c79e38afe1c', - 'mode': 'heat', 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Lisa Bios', @@ -426,11 +426,11 @@ 'binary_sensors': dict({ 'low_battery': False, }), + 'climate_mode': 'heat', 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2019-03-27T01:00:00+01:00', 'hardware': '1', 'location': '446ac08dd04d4eff8ac57489757b7314', - 'mode': 'heat', 'model': 'Tom/Floor', 'model_id': '106-03', 'name': 'CV Kraan Garage', @@ -477,11 +477,11 @@ 'binary_sensors': dict({ 'low_battery': False, }), + 'climate_mode': 'auto', 'dev_class': 'zone_thermostat', 'firmware': '2016-10-27T02:00:00+02:00', 'hardware': '255', 'location': '08963fec7c53423ca5680aa4cb502c63', - 'mode': 'auto', 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Thermostat Badkamer',