Fixed the get_config_value method when the zwave node was changed while reading it.

This commit is contained in:
Stefan Jonasson 2015-10-31 23:34:19 +01:00
parent c4261ae2e0
commit ec732becfc

View File

@ -61,10 +61,15 @@ def nice_print_node(node):
def get_config_value(node, value_index):
""" Returns the current config value for a specific index """
for _, value in node.values.items():
# 112 == config command class
if value.command_class == 112 and value.index == value_index:
return value.data
try:
for value in node.values.values():
# 112 == config command class
if value.command_class == 112 and value.index == value_index:
return value.data
except RuntimeError:
# If we get an runtime error the dict has changed while
# we was looking for a value, just do it again
return get_config_value(node, value_index)
def setup(hass, config):