Add support to hardcode hosts of WeMos
This commit is contained in:
1 parent
ea22695aa7
commit
8e65afa994
2 files changed
+13
-3
No files matched your search
@@ -61,8 +61,18 @@ def setup(hass, hosts=None):
|
||||
|
||||
return False
|
||||
|
||||
logger.info("Scanning for WeMo devices")
|
||||
devices = pywemo.discover_devices()
|
||||
if hosts:
|
||||
devices = []
|
||||
|
||||
for host in hosts:
|
||||
device = pywemo.device_from_host(host)
|
||||
|
||||
if device:
|
||||
devices.append(device)
|
||||
|
||||
else:
|
||||
logger.info("Scanning for WeMo devices")
|
||||
devices = pywemo.discover_devices()
|
||||
|
||||
is_switch = lambda switch: isinstance(switch, pywemo.Switch)
|
||||
|
||||
|
||||
Vendored
+1
-1
Submodule homeassistant/external/pywemo updated: 0e87fe7d72...c620385410.
Reference in new issue
Block a user