Skip to content

Commit

Permalink
Do not throw an error if heater/cooler entity is not yet available on…
Browse files Browse the repository at this point in the history
… startup
  • Loading branch information
Chupaka committed Oct 23, 2023
1 parent f965368 commit dbbad7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,10 @@ def _is_device_active(self):
return self.hass.states.is_state(self.heater_or_cooler_entity, STATE_ON)
else:
"""If the valve device is currently active."""
return float(self.hass.states.get(self.heater_or_cooler_entity).state) > 0
try: # do not throw an error if the state is not yet available on startup
return float(self.hass.states.get(self.heater_or_cooler_entity).state) > 0
except:
return False

@property
def supported_features(self):
Expand Down

0 comments on commit dbbad7e

Please sign in to comment.