diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index 03cb18b29a4..7b99b1882ae 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -12,9 +12,7 @@ from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' - '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' - '#python-wink==0.3'] +REQUIREMENTS = ['python-wink==0.3.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 1ab8bcdc920..bbf4ef04f64 100644 --- a/homeassistant/components/lock/wink.py +++ b/homeassistant/components/lock/wink.py @@ -11,9 +11,7 @@ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' - '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' - '#python-wink==0.3'] +REQUIREMENTS = ['python-wink==0.3.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 8815b933d7e..c93e93b32de 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -11,9 +11,7 @@ import logging from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED -REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' - '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' - '#python-wink==0.3'] +REQUIREMENTS = ['python-wink==0.3.1'] def setup_platform(hass, config, add_devices, discovery_info=None): @@ -32,6 +30,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pywink.set_bearer_token(token) add_devices(WinkSensorDevice(sensor) for sensor in pywink.get_sensors()) + add_devices(WinkEggMinder(eggtray) for eggtray in pywink.get_eggtrays()) class WinkSensorDevice(Entity): @@ -48,7 +47,7 @@ class WinkSensorDevice(Entity): @property def unique_id(self): """ Returns the id of this wink sensor """ - return "{}.{}".format(self.__class__, self.wink.deviceId()) + return "{}.{}".format(self.__class__, self.wink.device_id()) @property def name(self): @@ -57,9 +56,35 @@ class WinkSensorDevice(Entity): def update(self): """ Update state of the sensor. """ - self.wink.updateState() + self.wink.update_state() @property def is_open(self): """ True if door is open. """ return self.wink.state() + + +class WinkEggMinder(Entity): + """ Represents a Wink Egg Minder. """ + + def __init__(self, wink): + self.wink = wink + + @property + def state(self): + """ Returns the state. """ + return self.wink.state() + + @property + def unique_id(self): + """ Returns the id of this wink Egg Minder """ + return "{}.{}".format(self.__class__, self.wink.device_id()) + + @property + def name(self): + """ Returns the name of the Egg Minder if any. """ + return self.wink.name() + + def update(self): + """ Update state of the Egg Minder. """ + self.wink.update_state() diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index 7e3de1ed12e..e64245c430d 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -11,9 +11,7 @@ import logging from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' - '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' - '#python-wink==0.3'] +REQUIREMENTS = ['python-wink==0.3.1'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 32ec26555b0..9f28183a149 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -1,8 +1,7 @@ """ homeassistant.components.wink -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Connects to a Wink hub and loads relevant components to control its devices. - For more details about this component, please refer to the documentation at https://home-assistant.io/components/wink/ """ @@ -17,9 +16,7 @@ from homeassistant.const import ( ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME) DOMAIN = "wink" -REQUIREMENTS = ['https://github.com/bradsk88/python-wink/archive/' - '91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip' - '#python-wink==0.3'] +REQUIREMENTS = ['python-wink==0.3.1'] DISCOVER_LIGHTS = "wink.lights" DISCOVER_SWITCHES = "wink.switches" @@ -41,7 +38,8 @@ def setup(hass, config): for component_name, func_exists, discovery_type in ( ('light', pywink.get_bulbs, DISCOVER_LIGHTS), ('switch', pywink.get_switches, DISCOVER_SWITCHES), - ('sensor', pywink.get_sensors, DISCOVER_SENSORS), + ('sensor', lambda: pywink.get_sensors or pywink.get_eggtrays, + DISCOVER_SENSORS), ('lock', pywink.get_locks, DISCOVER_LOCKS)): if func_exists(): diff --git a/requirements_all.txt b/requirements_all.txt index 73091a50de9..ee0fda505ca 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -63,7 +63,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/bradsk88/python-wink/archive/91c8e9a5df24c8dd1a5267dc29a00a40c11d826a.zip#python-wink==0.3 +python-wink==0.3.1 # homeassistant.components.media_player.cast pychromecast==0.6.12