Skip to content

Commit

Permalink
Combine cases
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew committed Dec 27, 2023
1 parent fa5f93c commit cb8219c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugwise/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit cb8219c

Please sign in to comment.