Merge pull request #1564 from balloob/fix_template_race_condition
Fix remaining race condition in template components.
This commit is contained in:
commit
c093a2bf54
4 changed files with 5 additions and 5 deletions
|
@ -91,7 +91,7 @@ class BinarySensorTemplate(BinarySensorDevice):
|
|||
hass.bus.listen(EVENT_STATE_CHANGED, self._event_listener)
|
||||
|
||||
def _event_listener(self, event):
|
||||
if not hasattr(self, 'hass'):
|
||||
if not hasattr(self, 'hass') or self.hass is None:
|
||||
return
|
||||
self.update_ha_state(True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue