improve cooling/heatingOn states
This commit is contained in:
parent
4561ebb552
commit
74d078badf
@ -267,19 +267,20 @@ def pollAirco(info):
|
|||||||
targetTemperature = airco.stateValue(aircoTargetTemperatureStateTypeId)
|
targetTemperature = airco.stateValue(aircoTargetTemperatureStateTypeId)
|
||||||
temperature = airco.stateValue(aircoTemperatureStateTypeId)
|
temperature = airco.stateValue(aircoTemperatureStateTypeId)
|
||||||
mode = airco.stateValue(aircoModeStateTypeId)
|
mode = airco.stateValue(aircoModeStateTypeId)
|
||||||
if mode == "Cooling":
|
power = airco.stateValue(aircoPowerStateTypeId)
|
||||||
|
if mode == "Cooling" and power == True:
|
||||||
airco.setStateValue(aircoHeatingOnStateTypeId, False)
|
airco.setStateValue(aircoHeatingOnStateTypeId, False)
|
||||||
if targetTemperature < temperature:
|
if targetTemperature < temperature:
|
||||||
airco.setStateValue(aircoCoolingOnStateTypeId, True)
|
airco.setStateValue(aircoCoolingOnStateTypeId, True)
|
||||||
else:
|
else:
|
||||||
airco.setStateValue(aircoCoolingOnStateTypeId, False)
|
airco.setStateValue(aircoCoolingOnStateTypeId, False)
|
||||||
elif mode == "Heating":
|
elif mode == "Heating" and power == True:
|
||||||
airco.setStateValue(aircoCoolingOnStateTypeId, False)
|
airco.setStateValue(aircoCoolingOnStateTypeId, False)
|
||||||
if targetTemperature > temperature:
|
if targetTemperature > temperature:
|
||||||
airco.setStateValue(aircoHeatingOnStateTypeId, True)
|
airco.setStateValue(aircoHeatingOnStateTypeId, True)
|
||||||
else:
|
else:
|
||||||
airco.setStateValue(aircoHeatingOnStateTypeId, False)
|
airco.setStateValue(aircoHeatingOnStateTypeId, False)
|
||||||
elif mode == "Automatic":
|
elif mode == "Automatic" and power == True:
|
||||||
if targetTemperature == temperature:
|
if targetTemperature == temperature:
|
||||||
airco.setStateValue(aircoCoolingOnStateTypeId, False)
|
airco.setStateValue(aircoCoolingOnStateTypeId, False)
|
||||||
airco.setStateValue(aircoHeatingOnStateTypeId, False)
|
airco.setStateValue(aircoHeatingOnStateTypeId, False)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user