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:
1 parent
338077f557
commit
25e5864a22
3 files changed
+74
-59
No files matched your search
@@ -35,7 +35,7 @@ WEMO_OFF = 0
|
||||
WEMO_STANDBY = 8
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities_callback, discovery_info=None):
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up discovered WeMo switches."""
|
||||
from pywemo import discovery
|
||||
|
||||
@@ -51,7 +51,7 @@ def setup_platform(hass, config, add_entities_callback, discovery_info=None):
|
||||
raise PlatformNotReady
|
||||
|
||||
if device:
|
||||
add_entities_callback([WemoSwitch(device)])
|
||||
add_entities([WemoSwitch(device)])
|
||||
|
||||
|
||||
class WemoSwitch(SwitchDevice):
|
||||
|
||||
Reference in new issue
Block a user