mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Add LightSwitch to discovery, default unnown devices to switches for compatability.
This commit is contained in:
parent
72144945b4
commit
bbf8897a51
@ -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):
|
|||||||
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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user