Merge of nested IF-IF cases - K-N (#48370)

This commit is contained in:
Franck Nijhof 2021-03-27 10:03:15 +01:00 committed by GitHub
parent 9737480742
commit 86212db71d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 86 additions and 65 deletions

View file

@ -334,12 +334,19 @@ class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
new_cool_temp = min_temp + deadband
# Check that we're within the deadband range, fix it if we're not
if new_heat_temp and new_heat_temp != cur_heat_temp:
if new_cool_temp - new_heat_temp < deadband:
new_cool_temp = new_heat_temp + deadband
if new_cool_temp and new_cool_temp != cur_cool_temp:
if new_cool_temp - new_heat_temp < deadband:
new_heat_temp = new_cool_temp - deadband
if (
new_heat_temp
and new_heat_temp != cur_heat_temp
and new_cool_temp - new_heat_temp < deadband
):
new_cool_temp = new_heat_temp + deadband
if (
new_cool_temp
and new_cool_temp != cur_cool_temp
and new_cool_temp - new_heat_temp < deadband
):
new_heat_temp = new_cool_temp - deadband
self._zone.set_heat_cool_temp(
heat_temperature=new_heat_temp,