Added wink power strip support

This commit is contained in:
William Scanlon 2016-01-06 12:22:50 -05:00
parent 431656bbcf
commit 17dd8ddc9a
2 changed files with 6 additions and 3 deletions

View File

@ -30,3 +30,5 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
pywink.set_bearer_token(token)
add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches())
add_devices(WinkToggleDevice(switch) for switch in
pywink.get_powerstrip_outlets())

View File

@ -37,9 +37,10 @@ def setup(hass, config):
# Load components for the devices in the Wink that we support
for component_name, func_exists, discovery_type in (
('light', pywink.get_bulbs, DISCOVER_LIGHTS),
('switch', pywink.get_switches, DISCOVER_SWITCHES),
('sensor', lambda: pywink.get_sensors or pywink.get_eggtrays,
DISCOVER_SENSORS),
('switch', lambda: pywink.get_switches or
pywink.get_powerstrip_outlets, DISCOVER_SWITCHES),
('sensor', lambda: pywink.get_sensors or
pywink.get_eggtrays, DISCOVER_SENSORS),
('lock', pywink.get_locks, DISCOVER_LOCKS)):
if func_exists():