Merge pull request #1428 from balloob/hotfix/0.14.1

Hotfix/0.14.1
This commit is contained in:
Paulus Schoutsen 2016-02-28 09:26:36 -08:00
commit 3f4e34727d

View File

@ -58,12 +58,12 @@ def setup(hass, config):
def discovery_dispatch(service, discovery_info):
"""Dispatcher for WeMo discovery events."""
# name, model, location, mac
_, model_name, _, mac = discovery_info
_, model_name, url, _ = discovery_info
# Only register a device once
if mac in KNOWN_DEVICES:
if url in KNOWN_DEVICES:
return
KNOWN_DEVICES.append(mac)
KNOWN_DEVICES.append(url)
service = WEMO_MODEL_DISPATCH.get(model_name) or DISCOVER_SWITCHES
component = WEMO_SERVICE_DISPATCH.get(service)
@ -77,7 +77,8 @@ def setup(hass, config):
devices = [(device.host, device) for device in pywemo.discover_devices()]
# Add static devices from the config file
devices.extend((address, None) for address in config.get('static', []))
devices.extend((address, None)
for address in config.get(DOMAIN, {}).get('static', []))
for address, device in devices:
port = pywemo.ouimeaux_device.probe_wemo(address)