Added wink component to auto-load other needed components

This commit is contained in:
Paulus Schoutsen 2015-01-10 23:47:23 -08:00
parent 249cf244ca
commit 6cd53f2ddf
10 changed files with 147 additions and 56 deletions

View file

@ -24,16 +24,16 @@ def get_devices(hass, config):
if isinstance(switch, pywemo.Switch)]
def device_discovered(hass, config, info):
def devices_discovered(hass, config, info):
""" Called when a device is discovered. """
_, discovery = get_pywemo()
if discovery is None:
return
return []
device = discovery.device_from_description(info)
return None if device is None else WemoSwitch(device)
return [] if device is None else [WemoSwitch(device)]
def get_pywemo():