Skip to content

Commit

Permalink
test self.hass in setT15
Browse files Browse the repository at this point in the history
  • Loading branch information
frodef committed Aug 1, 2023
1 parent 17b73f6 commit e5fe5da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/nilan_cts600/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ async def _update_T15_state (self, entity_id, old_state, new_state):
""" Update thermostat with latest (room) temperature from sensor."""
if new_state.state is None or new_state.state in ["unknown", "unavailable"]:
return
if not self.hass:
return

sensor_unit = new_state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) or UnitOfTemperature.CELSIUS
value = TemperatureConverter.convert(
Expand Down

0 comments on commit e5fe5da

Please sign in to comment.