mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Handle startup race condition.
This commit is contained in:
parent
399fda079f
commit
fe2adff017
@ -45,6 +45,9 @@ class WemoBinarySensor(BinarySensorDevice):
|
|||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
'Subscription update for %s',
|
'Subscription update for %s',
|
||||||
_device)
|
_device)
|
||||||
|
if not hasattr(self, 'hass'):
|
||||||
|
self.update()
|
||||||
|
return
|
||||||
self.update_ha_state(True)
|
self.update_ha_state(True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -63,6 +63,9 @@ class WemoSwitch(SwitchDevice):
|
|||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
'Subscription update for %s',
|
'Subscription update for %s',
|
||||||
_device)
|
_device)
|
||||||
|
if not hasattr(self, 'hass'):
|
||||||
|
self.update()
|
||||||
|
return
|
||||||
self.update_ha_state(True)
|
self.update_ha_state(True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user