From cb8219cc1f502a832816335fa14258f6c5ef1537 Mon Sep 17 00:00:00 2001 From: Bouwe Date: Wed, 27 Dec 2023 15:59:00 +0100 Subject: [PATCH] Combine cases --- plugwise/helper.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 2800e3c708..28c0cd3584 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -860,12 +860,11 @@ def _appliance_measurements( sw_key = cast(SwitchType, measurement) sw_value = appl_p_loc.text in ["on", "true"] data["switches"][sw_key] = sw_value - case "c_heating_state": + case _ as measurement if measurement in ( + "c_heating_state", "thermostat_supports_cooling" + ): value = appl_p_loc.text in ["on", "true"] - data["c_heating_state"] = value - case "thermostat_supports_cooling": - value = appl_p_loc.text in ["on", "true"] - data["thermostat_supports_cooling"] = value + data[measurement] = value case "elga_status_code": data["elga_status_code"] = int(appl_p_loc.text)