From 2b4be33a3d51bfb483fa122b3da2e5050a628f5e Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Sat, 27 Feb 2016 20:33:35 -0800 Subject: [PATCH] Fix wemo known device tracking The wemo component was tracking devices by mac to avoid adding duplicates, but this means we'd never be able to load more than one static wemo, since they all have mac=None. This changes the code to track by url, which has to be unique per wemo anyway, and which we also have for even static wemos. --- homeassistant/components/wemo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/wemo.py b/homeassistant/components/wemo.py index e7fb426fe37..0427815c6e1 100644 --- a/homeassistant/components/wemo.py +++ b/homeassistant/components/wemo.py @@ -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)