Merge pull request #1213 from MartinHjelmare/mysensors-light

Add mysensors light platform
This commit is contained in:
Paulus Schoutsen committed 2016-02-12 19:01:41 -08:00
commit 7dd51034cd
5 files changed
+257 -19

No files matched your search

+4 -3
View File
@@ -1,5 +1,6 @@
"""
homeassistant.components.sensor.mysensors
homeassistant.components.sensor.mysensors.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for MySensors sensors.
@@ -30,7 +31,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
for gateway in mysensors.GATEWAYS.values():
# Define the S_TYPES and V_TYPES that the platform should handle as
# states. Map them in a defaultdict(list).
# states. Map them in a dict of lists.
pres = gateway.const.Presentation
set_req = gateway.const.SetReq
map_sv_types = {
@@ -190,7 +191,7 @@ class MySensorsSensor(Entity):
node = self.gateway.sensors[self.node_id]
child = node.children[self.child_id]
for value_type, value in child.values.items():
_LOGGER.info(
_LOGGER.debug(
"%s: value_type %s, value = %s", self._name, value_type, value)
if value_type == self.gateway.const.SetReq.V_TRIPPED:
self._values[value_type] = STATE_ON if int(