Fix noisy error on startup. Make callbacks code consistent.
This commit is contained in:
parent
b16c17fae5
commit
4e3c8a8697
3 changed files with 14 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue