diff --git a/homeassistant/components/discovery.py b/homeassistant/components/discovery.py index 1860fe8110e..efa3aa47cbf 100644 --- a/homeassistant/components/discovery.py +++ b/homeassistant/components/discovery.py @@ -37,8 +37,10 @@ def listen(hass, service, callback): Service can be a string or a list/tuple. """ - if not isinstance(service, str): + if isinstance(service, str): service = (service,) + else: + service = tuple(service) def discovery_event_listener(event): """ Listens for discovery events. """ diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 7b56a981901..b169c0d44d5 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -191,7 +191,7 @@ def setup(hass, config): platform = get_component( "{}.{}".format(DOMAIN, DISCOVERY_PLATFORMS[service])) - discovered = platform.device_discovered(hass, config, info) + discovered = platform.devices_discovered(hass, config, info) for light in discovered: if light is not None and light not in lights.values(): diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index ada55f90cb8..a2f45dadef5 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -35,9 +35,9 @@ def setup(hass, config): ('light', pywink.get_bulbs, DISCOVER_LIGHTS), ('switch', pywink.get_switches, DISCOVER_SWITCHES)): - component = get_component(component_name) - if func_exists(): + component = get_component(component_name) + # Ensure component is loaded if component.DOMAIN not in hass.components: # Add a worker on succesfull setup @@ -49,3 +49,5 @@ def setup(hass, config): ATTR_SERVICE: discovery_type, ATTR_DISCOVERED: {} }) + + return True