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 authored and Teagan Glenn committed 2016-08-27 14:41:21 -06:00
1 parent 6f1c97b9d3
commit 6acaf25b0d
5 files changed
+68 -57

No files matched your search

@@ -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',