mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Merge pull request #1425 from kk7ds/fix-static-wemos
Fix static configured wemo devices
This commit is contained in:
commit
f5dd41e019
@ -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['wemo'].get('static', []))
|
||||
|
||||
for address, device in devices:
|
||||
port = pywemo.ouimeaux_device.probe_wemo(address)
|
||||
|
Loading…
x
Reference in New Issue
Block a user