From ec732becfce6eb68b666997cb68ab7de0131d9b6 Mon Sep 17 00:00:00 2001 From: Stefan Jonasson Date: Sat, 31 Oct 2015 23:34:19 +0100 Subject: [PATCH] Fixed the get_config_value method when the zwave node was changed while reading it. --- homeassistant/components/zwave.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/zwave.py b/homeassistant/components/zwave.py index 755908ad2d4..9f7df64312d 100644 --- a/homeassistant/components/zwave.py +++ b/homeassistant/components/zwave.py @@ -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):