mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Bugfixes to make Wink component work
This commit is contained in:
parent
6cd53f2ddf
commit
9db1f3f8b7
@ -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. """
|
||||
|
@ -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():
|
||||
|
@ -35,9 +35,9 @@ def setup(hass, config):
|
||||
('light', pywink.get_bulbs, DISCOVER_LIGHTS),
|
||||
('switch', pywink.get_switches, DISCOVER_SWITCHES)):
|
||||
|
||||
if func_exists():
|
||||
component = get_component(component_name)
|
||||
|
||||
if func_exists():
|
||||
# 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user