Support for wink oath2 and relay sensors (#3496)

This commit is contained in:
William Scanlon
2016-10-01 23:45:39 -04:00
committed by Paulus Schoutsen
parent 996d7cf1cd
commit 1f38e9fa57
4 changed files with 57 additions and 14 deletions

View File

@@ -20,7 +20,8 @@ SENSOR_TYPES = {
"vibration": "vibration",
"loudness": "sound",
"liquid_detected": "moisture",
"motion": "motion"
"motion": "motion",
"presence": "occupancy"
}
@@ -58,17 +59,21 @@ class WinkBinarySensorDevice(WinkDevice, BinarySensorDevice, Entity):
def is_on(self):
"""Return true if the binary sensor is on."""
if self.capability == "loudness":
return self.wink.loudness_boolean()
state = self.wink.loudness_boolean()
elif self.capability == "vibration":
return self.wink.vibration_boolean()
state = self.wink.vibration_boolean()
elif self.capability == "brightness":
return self.wink.brightness_boolean()
state = self.wink.brightness_boolean()
elif self.capability == "liquid_detected":
return self.wink.liquid_boolean()
state = self.wink.liquid_boolean()
elif self.capability == "motion":
return self.wink.motion_boolean()
state = self.wink.motion_boolean()
elif self.capability == "presence":
state = self.wink.presence_boolean()
else:
return self.wink.state()
state = self.wink.state()
return state
@property
def sensor_class(self):