mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 07:08:20 +00:00
Fix conditions
This commit is contained in:
parent
a7ee95f999
commit
100640474a
@ -45,7 +45,7 @@ def validate_recursive_condition(value):
|
|||||||
u"".format(key, key2))
|
u"".format(key, key2))
|
||||||
validator = CONDITION_REGISTRY[key][0]
|
validator = CONDITION_REGISTRY[key][0]
|
||||||
value[i] = {
|
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])
|
key: validator(item[key])
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
@ -316,7 +316,7 @@ def build_actions(config, arg_type):
|
|||||||
|
|
||||||
|
|
||||||
def build_condition(full_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)
|
key, config = next((k, v) for k, v in full_config.items() if k in CONDITION_REGISTRY)
|
||||||
|
|
||||||
builder = CONDITION_REGISTRY[key][1]
|
builder = CONDITION_REGISTRY[key][1]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
esphomeyaml:
|
esphomeyaml:
|
||||||
name: test2
|
name: $devicename
|
||||||
platform: ESP32
|
platform: ESP32
|
||||||
board: nodemcu-32s
|
board: nodemcu-32s
|
||||||
# Use latest upstream esphomelib git version.
|
# Use latest upstream esphomelib git version.
|
||||||
@ -11,6 +11,9 @@ esphomeyaml:
|
|||||||
use_custom_code: true
|
use_custom_code: true
|
||||||
build_path: build/test2
|
build_path: build/test2
|
||||||
|
|
||||||
|
substitutions:
|
||||||
|
devicename: test2
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: 'MySSID'
|
ssid: 'MySSID'
|
||||||
password: 'password1'
|
password: 'password1'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user