Skip to content

Commit

Permalink
Another fix for No entities due to setTemperature = None mariusz-osto…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Ostoja-Świerczyński committed Nov 22, 2020
1 parent 24b60bc commit b3b2c73
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ def __init__(self, device, api, config_entry):

def update_properties(self, device):
self._name = device["description"]["name"]
setTemperature = device["zone"]["setTemperature"]
if setTemperature is not None:
self._target_temperature = setTemperature / 10
currentTemperature = device["zone"]["currentTemperature"]
if currentTemperature is not None:
self._temperature = currentTemperature / 10
if device["zone"]["setTemperature"] is not None:
self._target_temperature = device["zone"]["setTemperature"] / 10
else:
self._target_temperature = None
if device["zone"]["currentTemperature"] is not None:
self._temperature = device["zone"]["currentTemperature"] / 10
else:
self._temperature = None
state = device["zone"]["flags"]["relayState"]
if state == "on":
self._state = CURRENT_HVAC_HEAT
Expand Down

0 comments on commit b3b2c73

Please sign in to comment.