mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Fix race condition in template components.
This commit is contained in:
@@ -82,7 +82,7 @@ class SensorTemplate(Entity):
|
||||
|
||||
def _event_listener(self, event):
|
||||
"""Called when the target device changes state."""
|
||||
if not hasattr(self, 'hass'):
|
||||
if not hasattr(self, 'hass') or self.hass is None:
|
||||
return
|
||||
self.update_ha_state(True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user