diff --git a/esphomeyaml/automation.py b/esphomeyaml/automation.py index 824d1908e1..a1f1dd7d57 100644 --- a/esphomeyaml/automation.py +++ b/esphomeyaml/automation.py @@ -45,7 +45,7 @@ def validate_recursive_condition(value): u"".format(key, key2)) validator = CONDITION_REGISTRY[key][0] value[i] = { - CONF_CONDITION_ID: cv.declare_variable_id(Condition)(item[CONF_ACTION_ID]), + CONF_CONDITION_ID: cv.declare_variable_id(Condition)(item[CONF_CONDITION_ID]), key: validator(item[key]) } return value @@ -316,7 +316,7 @@ def build_actions(config, arg_type): def build_condition(full_config, arg_type): - action_id = full_config[CONF_ACTION_ID] + action_id = full_config[CONF_CONDITION_ID] key, config = next((k, v) for k, v in full_config.items() if k in CONDITION_REGISTRY) builder = CONDITION_REGISTRY[key][1] diff --git a/tests/test2.yaml b/tests/test2.yaml index 1e1e3195d7..a7e7b325de 100644 --- a/tests/test2.yaml +++ b/tests/test2.yaml @@ -1,5 +1,5 @@ esphomeyaml: - name: test2 + name: $devicename platform: ESP32 board: nodemcu-32s # Use latest upstream esphomelib git version. @@ -11,6 +11,9 @@ esphomeyaml: use_custom_code: true build_path: build/test2 +substitutions: + devicename: test2 + wifi: ssid: 'MySSID' password: 'password1'