mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 20:55:10 +02:00
Add support to hardcode hosts of WeMos
This commit is contained in:
@@ -61,8 +61,18 @@ def setup(hass, hosts=None):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
logger.info("Scanning for WeMo devices")
|
if hosts:
|
||||||
devices = pywemo.discover_devices()
|
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)
|
is_switch = lambda switch: isinstance(switch, pywemo.Switch)
|
||||||
|
|
||||||
|
2
homeassistant/external/pywemo
vendored
2
homeassistant/external/pywemo
vendored
Submodule homeassistant/external/pywemo updated: 0e87fe7d72...c620385410
Reference in New Issue
Block a user