Remove @property from update function

pull/747/head
William Scanlon 2015-12-14 18:31:09 -05:00
parent 5755c6f593
commit c1d728ce00
2 changed files with 12 additions and 14 deletions

View File

@ -10,8 +10,8 @@ import logging
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_ACCESS_TOKEN
REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/'
'42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip'
REQUIREMENTS = ['https://github.com/w1ll1am23/python-wink/archive/'
'master.zip'
'#python-wink==0.2']
def setup_platform(hass, config, add_devices, discovery_info=None):
@ -41,7 +41,7 @@ class WinkEggMinder(Entity):
@property
def state(self):
""" Returns the state. """
return self.egg_count
return self.wink.state()
@property
def unique_id(self):
@ -53,12 +53,11 @@ class WinkEggMinder(Entity):
""" Returns the name of the sensor if any. """
return self.wink.name()
@property
def update(self):
""" Update state of the Egg Minder. """
self.wink.updateState()
@property
def egg_count(self):
""" The number of eggs """
return self.wink.state()
#@property
#def egg_count(self):
# """ The number of eggs """
# return self.wink.state()

View File

@ -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,14 +16,14 @@ from homeassistant.const import (
ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME)
DOMAIN = "wink"
DEPENDENCIES = []
REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/'
'9eb39eaba0717922815e673ad1114c685839d890.zip'
'#python-wink==0.1.1']
'42fdcfa721b1bc583688e3592d8427f4c13ba6d9.zip'
'#python-wink==0.2']
DISCOVER_LIGHTS = "wink.lights"
DISCOVER_SWITCHES = "wink.switches"
DISCOVER_SENSORS = "wink.sensors"
DISCOVER_LOCKS = "wink.locks"
def setup(hass, config):
@ -42,7 +41,7 @@ def setup(hass, config):
('light', pywink.get_bulbs, DISCOVER_LIGHTS),
('switch', pywink.get_switches, DISCOVER_SWITCHES),
('sensor', pywink.get_sensors, DISCOVER_SENSORS),
('sensor', pywink.get_eggtrays, DISCOVER_SENSORS)):
('lock', pywink.get_locks, DISCOVER_LOCKS)):
if func_exists():
component = get_component(component_name)