From 17dd8ddc9a20e08067a8fa4ef364bbad25fe43c1 Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Wed, 6 Jan 2016 12:22:50 -0500 Subject: [PATCH 1/3] Added wink power strip support --- homeassistant/components/switch/wink.py | 2 ++ homeassistant/components/wink.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index e64245c430d..297777d3145 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -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()) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 9f28183a149..bc8e83b291c 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -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(): From 2803631906f968a9790f5b240489116c5f748aed Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Fri, 8 Jan 2016 08:25:26 -0500 Subject: [PATCH 2/3] Updated python-wink to 0.4.0 --- homeassistant/components/light/wink.py | 2 +- homeassistant/components/lock/wink.py | 2 +- homeassistant/components/sensor/wink.py | 2 +- homeassistant/components/switch/wink.py | 5 ++--- homeassistant/components/wink.py | 2 +- requirements_all.txt | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index 7b99b1882ae..b5066ca49f7 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -12,7 +12,7 @@ from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices_callback, discovery_info=None): diff --git a/homeassistant/components/lock/wink.py b/homeassistant/components/lock/wink.py index bbf4ef04f64..10324c4e46e 100644 --- a/homeassistant/components/lock/wink.py +++ b/homeassistant/components/lock/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/sensor/wink.py b/homeassistant/components/sensor/wink.py index c93e93b32de..77b53e5e9af 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index 297777d3145..f8335fc3c54 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices, discovery_info=None): @@ -30,5 +30,4 @@ 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()) + add_devices(WinkToggleDevice(switch) for switch in pywink.get_powerstrip_outlets()) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index bc8e83b291c..996d5ebb44f 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -16,7 +16,7 @@ from homeassistant.const import ( ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME) DOMAIN = "wink" -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] DISCOVER_LIGHTS = "wink.lights" DISCOVER_SWITCHES = "wink.switches" diff --git a/requirements_all.txt b/requirements_all.txt index 5566e67fb9f..ef7ab2a67ae 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -66,7 +66,7 @@ pyvera==0.2.2 # homeassistant.components.lock.wink # homeassistant.components.sensor.wink # homeassistant.components.switch.wink -python-wink==0.3.1 +python-wink==0.4.0 # homeassistant.components.media_player.cast pychromecast==0.6.13 From de5bee635914ff781a35d3c109d3372a39303ee8 Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Thu, 14 Jan 2016 08:56:59 -0500 Subject: [PATCH 3/3] Updated python-wink version --- homeassistant/components/light/wink.py | 2 +- homeassistant/components/lock/wink.py | 2 +- homeassistant/components/sensor/wink.py | 2 +- homeassistant/components/switch/wink.py | 5 +++-- homeassistant/components/wink.py | 2 +- requirements_all.txt | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index b5066ca49f7..294f092c050 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -12,7 +12,7 @@ from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices_callback, discovery_info=None): diff --git a/homeassistant/components/lock/wink.py b/homeassistant/components/lock/wink.py index 10324c4e46e..6c457c722f9 100644 --- a/homeassistant/components/lock/wink.py +++ b/homeassistant/components/lock/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/sensor/wink.py b/homeassistant/components/sensor/wink.py index 77b53e5e9af..8acc99f2d3d 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index f8335fc3c54..e01065c3cd4 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices, discovery_info=None): @@ -30,4 +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()) + add_devices(WinkToggleDevice(switch) for switch in + pywink.get_powerstrip_outlets()) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 996d5ebb44f..a719c5613a4 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -16,7 +16,7 @@ from homeassistant.const import ( ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME) DOMAIN = "wink" -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] DISCOVER_LIGHTS = "wink.lights" DISCOVER_SWITCHES = "wink.switches" diff --git a/requirements_all.txt b/requirements_all.txt index ef7ab2a67ae..0457fbb0266 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -66,7 +66,7 @@ pyvera==0.2.2 # homeassistant.components.lock.wink # homeassistant.components.sensor.wink # homeassistant.components.switch.wink -python-wink==0.4.0 +python-wink==0.4.1 # homeassistant.components.media_player.cast pychromecast==0.6.13