Improve Wemo setup speed (#19563)

* Wemo - Improve setup speed

Move WeMo device discovery to an async context so it won't block initial component setup from completing quickly.

* WeMo - Fix too long lines

* WeMo - Update subscription shutdown log message

* WeMo - Fix flake8 issues

* WeMo - Code review fixes

* WeMo - Fix long lines

* WeMo - More code review fixes

* WeMo - Code review fixes
This commit is contained in:
Adam Belebczuk authored and Martin Hjelmare committed 2018-12-29 16:05:21 -08:00
1 parent 338077f557
commit 25e5864a22
3 files changed
+74 -59

No files matched your search

@@ -18,7 +18,7 @@ DEPENDENCIES = ['wemo']
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities_callback, discovery_info=None):
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Register discovered WeMo binary sensors."""
from pywemo import discovery
@@ -34,7 +34,7 @@ def setup_platform(hass, config, add_entities_callback, discovery_info=None):
raise PlatformNotReady
if device:
add_entities_callback([WemoBinarySensor(hass, device)])
add_entities([WemoBinarySensor(hass, device)])
class WemoBinarySensor(BinarySensorDevice):