Merge pull request #1144 from MartinHjelmare/fix-mysensors-errors

Fix mysensors version errors
This commit is contained in:
Paulus Schoutsen committed 2016-02-06 11:35:49 -08:00
commit af0a44d976
2 files changed
+15 -6

No files matched your search

+7 -1
View File
@@ -100,10 +100,16 @@ class MySensorsSwitch(SwitchDevice):
@property
def device_state_attributes(self):
"""Return device specific state attributes."""
set_req = self.gateway.const.SetReq
device_attr = {}
for value_type, value in self._values.items():
if value_type != self.value_type:
device_attr[self.gateway.const.SetReq(value_type).name] = value
try:
device_attr[set_req(value_type).name] = value
except ValueError:
_LOGGER.error('value_type %s is not valid for mysensors '
'version %s', value_type,
self.gateway.version)
return device_attr
@property