Plugwise bump module version to fix heating-state and OnOff devices (#66936)

This commit is contained in:
Tom 2022-02-20 20:45:19 +01:00 committed by GitHub
parent 8c96f1457d
commit 620b653d76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 50 deletions

View file

@ -107,15 +107,16 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
if "control_state" in self.device:
if self.device.get("control_state") == "cooling":
return CURRENT_HVAC_COOL
if self.device.get("control_state") == "heating":
# Support preheating state as heating, until preheating is added as a separate state
if self.device.get("control_state") in ["heating", "preheating"]:
return CURRENT_HVAC_HEAT
else:
heater_central_data = self.coordinator.data.devices[
self.coordinator.data.gateway["heater_id"]
]
if heater_central_data.get("heating_state"):
if heater_central_data["binary_sensors"].get("heating_state"):
return CURRENT_HVAC_HEAT
if heater_central_data.get("cooling_state"):
if heater_central_data["binary_sensors"].get("cooling_state"):
return CURRENT_HVAC_COOL
return CURRENT_HVAC_IDLE