1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Fix conditions

This commit is contained in:
Otto Winter 2018-11-30 19:48:44 +01:00
parent a7ee95f999
commit 100640474a
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
2 changed files with 6 additions and 3 deletions

View File

@ -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]

View File

@ -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'