mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
Fix noisy error on startup. Make callbacks code consistent.
This commit is contained in:
@@ -90,6 +90,8 @@ class BinarySensorTemplate(BinarySensorDevice):
|
||||
hass.bus.listen(EVENT_STATE_CHANGED, self._event_listener)
|
||||
|
||||
def _event_listener(self, event):
|
||||
if not hasattr(self, 'hass'):
|
||||
return
|
||||
self.update_ha_state(True)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user