Skip to content
Snippets Groups Projects
Commit bbf8897a authored by pavoni's avatar pavoni
Browse files

Add LightSwitch to discovery, default unnown devices to switches for compatability.

parent 72144945
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ WEMO_MODEL_DISPATCH = { ...@@ -25,6 +25,7 @@ WEMO_MODEL_DISPATCH = {
'Maker': DISCOVER_SWITCHES, 'Maker': DISCOVER_SWITCHES,
'Motion': DISCOVER_MOTION, 'Motion': DISCOVER_MOTION,
'Socket': DISCOVER_SWITCHES, 'Socket': DISCOVER_SWITCHES,
'LightSwitch': DISCOVER_SWITCHES
} }
WEMO_SERVICE_DISPATCH = { WEMO_SERVICE_DISPATCH = {
DISCOVER_LIGHTS: 'light', DISCOVER_LIGHTS: 'light',
...@@ -64,12 +65,11 @@ def setup(hass, config): ...@@ -64,12 +65,11 @@ def setup(hass, config):
return return
KNOWN_DEVICES.append(mac) KNOWN_DEVICES.append(mac)
service = WEMO_MODEL_DISPATCH.get(model_name) service = WEMO_MODEL_DISPATCH.get(model_name) or DISCOVER_SWITCHES
component = WEMO_SERVICE_DISPATCH.get(service) component = WEMO_SERVICE_DISPATCH.get(service)
if service is not None: discovery.discover(hass, service, discovery_info,
discovery.discover(hass, service, discovery_info, component, config)
component, config)
discovery.listen(hass, discovery.SERVICE_WEMO, discovery_dispatch) discovery.listen(hass, discovery.SERVICE_WEMO, discovery_dispatch)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment