Use voluptuous for mysensors (#2992)

* Add voluptuous config validation for mysensors
* Remove and clean up parts that are not needed for pymysensors 0.7.
This commit is contained in:
Martin Hjelmare 2016-08-27 22:41:21 +02:00 committed by Teagan Glenn
parent 6f1c97b9d3
commit 6acaf25b0d
5 changed files with 68 additions and 57 deletions

View file

@ -32,7 +32,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
pres.S_MOTION: [set_req.V_TRIPPED],
pres.S_SMOKE: [set_req.V_TRIPPED],
}
if float(gateway.version) >= 1.5:
if float(gateway.protocol_version) >= 1.5:
map_sv_types.update({
pres.S_SPRINKLER: [set_req.V_TRIPPED],
pres.S_WATER_LEAK: [set_req.V_TRIPPED],
@ -66,7 +66,7 @@ class MySensorsBinarySensor(
pres.S_MOTION: 'motion',
pres.S_SMOKE: 'smoke',
}
if float(self.gateway.version) >= 1.5:
if float(self.gateway.protocol_version) >= 1.5:
class_map.update({
pres.S_SPRINKLER: 'sprinkler',
pres.S_WATER_LEAK: 'leak',