Merge pull request #1542 from balloob/fix_race_condition

Handle Wemo startup race condition.
pull/1487/merge
Paulus Schoutsen 2016-03-14 07:47:50 -07:00
commit 3e3d1ae9de
2 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,9 @@ class WemoBinarySensor(BinarySensorDevice):
_LOGGER.info(
'Subscription update for %s',
_device)
if not hasattr(self, 'hass'):
self.update()
return
self.update_ha_state(True)
@property

View File

@ -63,6 +63,9 @@ class WemoSwitch(SwitchDevice):
_LOGGER.info(
'Subscription update for %s',
_device)
if not hasattr(self, 'hass'):
self.update()
return
self.update_ha_state(True)
@property