Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/homeassistant/components/switch/wemo.py b/homeassistant/components/switch/wemo.py
- index 1d56944..4a996e1 100644
- --- a/homeassistant/components/switch/wemo.py
- +++ b/homeassistant/components/switch/wemo.py
- @@ -60,6 +60,28 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
- [WemoSwitch(switch) for switch in switches
- if isinstance(switch, pywemo.Switch)])
- + static_types = {
- + 'switch': pywemo.Switch,
- + 'insight': pywemo.Insight,
- + }
- +
- + # Add manually-defined wemo devices
- + if discovery_info is None and 'static' in config:
- + static_wemos = []
- + for address, devtype in config['static'].items():
- + devclass = static_types.get(devtype)
- + if not devclass:
- + _LOGGER.warning('Unknown static wemo type %s' % devtype)
- + continue
- + port = pywemo.ouimeaux_device.probe_wemo(address)
- + if not port:
- + _LOGGER.warning('Unable to probe wemo at %s' % address)
- + continue
- + _LOGGER.info('Adding static wemo at %s:%i' % (address, port))
- + wemo = devclass('http://%s:%i/setup.xml' % (address, port), None)
- + static_wemos.append(wemo)
- + add_devices_callback([WemoSwitch(wemo) for wemo in static_wemos])
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement