From 8e65afa994ac49b6a41ee3693f2622008a32081a Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 24 Apr 2014 22:53:35 -0700 Subject: [PATCH] Add support to hardcode hosts of WeMos --- homeassistant/components/wemo.py | 14 ++++++++++++-- homeassistant/external/pywemo | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/wemo.py b/homeassistant/components/wemo.py index 6e5983cd739..1892db66fdf 100644 --- a/homeassistant/components/wemo.py +++ b/homeassistant/components/wemo.py @@ -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) diff --git a/homeassistant/external/pywemo b/homeassistant/external/pywemo index 0e87fe7d724..c620385410e 160000 --- a/homeassistant/external/pywemo +++ b/homeassistant/external/pywemo @@ -1 +1 @@ -Subproject commit 0e87fe7d724aca851acfb5e756b751e072b03ca5 +Subproject commit c620385410ee4335a0e20f7c2a196cf67f8c5cf5