diff --git a/homeassistant/components/binary_sensor/wink.py b/homeassistant/components/binary_sensor/wink.py index 2d0e3f7226f..b129b5f24d4 100644 --- a/homeassistant/components/binary_sensor/wink.py +++ b/homeassistant/components/binary_sensor/wink.py @@ -40,6 +40,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): for sensor in pywink.get_smoke_and_co_detectors(): add_devices([WinkBinarySensorDevice(sensor, hass)]) + for hub in pywink.get_hubs(): + add_devices([WinkHub(hub, hass)]) + class WinkBinarySensorDevice(WinkDevice, BinarySensorDevice, Entity): """Representation of a Wink binary sensor.""" @@ -79,3 +82,24 @@ class WinkBinarySensorDevice(WinkDevice, BinarySensorDevice, Entity): def sensor_class(self): """Return the class of this sensor, from SENSOR_CLASSES.""" return SENSOR_TYPES.get(self.capability) + + +class WinkHub(WinkDevice, BinarySensorDevice, Entity): + """Representation of a Wink Hub.""" + + def __init(self, wink, hass): + """Initialize the hub sensor.""" + WinkDevice.__init__(self, wink, hass) + + @property + def device_state_attributes(self): + """Return the state attributes.""" + return { + 'update needed': self.wink.update_needed(), + 'firmware version': self.wink.firmware_version() + } + + @property + def is_on(self): + """Return true if the binary sensor is on.""" + return self.wink.state() diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index bb374afaf86..affeb376f5c 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -15,7 +15,7 @@ from homeassistant.const import ( from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['python-wink==0.10.1', 'pubnubsub-handler==0.0.5'] +REQUIREMENTS = ['python-wink==0.11.0', 'pubnubsub-handler==0.0.5'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index aefb21a93c9..cd16e47d620 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -471,7 +471,7 @@ python-telegram-bot==5.2.0 python-twitch==1.3.0 # homeassistant.components.wink -python-wink==0.10.1 +python-wink==0.11.0 # homeassistant.components.keyboard # pyuserinput==0.1.11