Added tamper detection to Wink devices. (#6072)

* Added tamper detection to wink devices.
This commit is contained in:
William Scanlon 2017-02-18 23:00:27 -05:00 committed by GitHub
parent 5f095b5126
commit a4318c3125
2 changed files with 30 additions and 16 deletions

View file

@ -92,13 +92,13 @@ class WinkBinarySensorDevice(WinkDevice, BinarySensorDevice, Entity):
def __init__(self, wink, hass):
"""Initialize the Wink binary sensor."""
super().__init__(wink, hass)
try:
if hasattr(self.wink, 'unit'):
self._unit_of_measurement = self.wink.unit()
except AttributeError:
else:
self._unit_of_measurement = None
try:
if hasattr(self.wink, 'capability'):
self.capability = self.wink.capability()
except AttributeError:
else:
self.capability = None
@property