From 58988787ea8ab403c3c089de94df719e371233d5 Mon Sep 17 00:00:00 2001 From: bradsk88 <7kcwKg60tdcW> Date: Tue, 15 Dec 2015 21:43:12 -0600 Subject: [PATCH] Updating to python-wink 0.3.0 --- homeassistant/components/light/wink.py | 10 +++++----- homeassistant/components/lock/wink.py | 18 ++++++++++-------- homeassistant/components/sensor/wink.py | 6 +++--- homeassistant/components/switch/wink.py | 6 +++--- homeassistant/components/wink.py | 17 +++++++++-------- requirements.txt | 2 +- requirements_all.txt | 11 ++++------- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index eaa703799f7..03cb18b29a4 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -12,9 +12,9 @@ from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/' - '42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip' - '#python-wink==0.2'] +REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' + '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' + '#python-wink==0.3'] def setup_platform(hass, config, add_devices_callback, discovery_info=None): @@ -45,10 +45,10 @@ class WinkLight(WinkToggleDevice): brightness = kwargs.get(ATTR_BRIGHTNESS) if brightness is not None: - self.wink.setState(True, brightness / 255) + self.wink.set_state(True, brightness=brightness / 255) else: - self.wink.setState(True) + self.wink.set_state(True) @property def state_attributes(self): diff --git a/homeassistant/components/lock/wink.py b/homeassistant/components/lock/wink.py index 27f602d65fa..3fd6d4bcf85 100644 --- a/homeassistant/components/lock/wink.py +++ b/homeassistant/components/lock/wink.py @@ -11,9 +11,9 @@ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/' - '42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip' - '#python-wink==0.2'] +REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' + '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' + '#python-wink==0.3'] def setup_platform(hass, config, add_devices, discovery_info=None): @@ -37,13 +37,15 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class WinkLockDevice(LockDevice): """ Represents a Wink lock. """ - def __init__(self, wink): + import pywink + + def __init__(self, wink: pywink.WinkLock): self.wink = wink @property def unique_id(self): """ Returns the id of this wink lock """ - return "{}.{}".format(self.__class__, self.wink.deviceId()) + return "{}.{}".format(self.__class__, self.wink.device_id()) @property def name(self): @@ -52,7 +54,7 @@ class WinkLockDevice(LockDevice): def update(self): """ Update the state of the lock. """ - self.wink.updateState() + self.wink.update_state() @property def is_locked(self): @@ -61,8 +63,8 @@ class WinkLockDevice(LockDevice): def lock(self): """ Lock the device. """ - self.wink.setState(True) + self.wink.set_state(True) def unlock(self): """ Unlock the device. """ - self.wink.setState(False) + self.wink.set_state(False) diff --git a/homeassistant/components/sensor/wink.py b/homeassistant/components/sensor/wink.py index 26fe6538e05..8815b933d7e 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -11,9 +11,9 @@ import logging from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED -REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/' - '42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip' - '#python-wink==0.2'] +REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' + '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' + '#python-wink==0.3'] 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 f0dc18003c6..7e3de1ed12e 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -11,9 +11,9 @@ import logging from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/' - '42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip' - '#python-wink==0.2'] +REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' + '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' + '#python-wink==0.3'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 1ab82236596..c597a43cb4d 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -17,9 +17,9 @@ from homeassistant.const import ( ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME) DOMAIN = "wink" -REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/' - '42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip' - '#python-wink==0.2'] +REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' + '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' + '#python-wink==0.3'] DISCOVER_LIGHTS = "wink.lights" DISCOVER_SWITCHES = "wink.switches" @@ -61,14 +61,15 @@ def setup(hass, config): class WinkToggleDevice(ToggleEntity): """ Represents a Wink toogle (switch) device. """ + import pywink - def __init__(self, wink): + def __init__(self, wink: pywink.WinkBinarySwitch): self.wink = wink @property def unique_id(self): """ Returns the id of this Wink switch. """ - return "{}.{}".format(self.__class__, self.wink.deviceId()) + return "{}.{}".format(self.__class__, self.wink.device_id()) @property def name(self): @@ -89,12 +90,12 @@ class WinkToggleDevice(ToggleEntity): def turn_on(self, **kwargs): """ Turns the switch on. """ - self.wink.setState(True) + self.wink.set_state(True) def turn_off(self): """ Turns the switch off. """ - self.wink.setState(False) + self.wink.set_state(False) def update(self): """ Update state of the light. """ - self.wink.updateState() + self.wink.update_state() diff --git a/requirements.txt b/requirements.txt index 1bcfe79c2d0..14dfca13f23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ requests>=2,<3 pyyaml>=3.11,<4 pytz>=2015.4 pip>=7.0.0 -vincenty==0.1.3 +vincenty==0.1.3 \ No newline at end of file diff --git a/requirements_all.txt b/requirements_all.txt index 5db0a85cee4..e2f8038578e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -60,7 +60,7 @@ https://github.com/pavoni/home-assistant-vera-api/archive/efdba4e63d58a30bc9b36d # homeassistant.components.lock.wink # homeassistant.components.sensor.wink # homeassistant.components.switch.wink -https://github.com/balloob/python-wink/archive/42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip#python-wink==0.2 +https://github.com/bradsk88/python-wink/archive/91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip#python-wink==0.3 # homeassistant.components.media_player.cast pychromecast==0.6.12 @@ -83,9 +83,6 @@ https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b6 # homeassistant.components.mqtt paho-mqtt==1.1 -# homeassistant.components.mqtt -jsonpath-rw==1.4.0 - # homeassistant.components.notify.pushbullet pushbullet.py==0.9.0 @@ -160,6 +157,9 @@ orvibo==1.0.1 # homeassistant.components.switch.wemo pywemo==0.3.3 +# homeassistant.components.thermostat.heatmiser +heatmiserV3==0.9.1 + # homeassistant.components.thermostat.honeywell evohomeclient==0.2.4 @@ -174,6 +174,3 @@ https://github.com/persandstrom/python-verisure/archive/9873c4527f01b1ba1f72ae60 # homeassistant.components.zwave pydispatcher==2.0.5 - -# homeassistant.components.heatmiser -heatmiserV3==0.9.1