mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
Fix automation validation
This commit is contained in:
parent
2fab7e73b9
commit
0ade9baf65
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
import copy
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import core
|
||||
|
@ -28,8 +30,9 @@ def validate_recursive_condition(value):
|
|||
|
||||
|
||||
def validate_recursive_action(value):
|
||||
value = cv.ensure_list(value)
|
||||
value = cv.ensure_list(value)[:]
|
||||
for i, item in enumerate(value):
|
||||
item = copy.deepcopy(item)
|
||||
if not isinstance(item, dict):
|
||||
raise vol.Invalid(u"Action must consist of key-value mapping! Got {}".format(item))
|
||||
key = next((x for x in item if x != CONF_ACTION_ID), None)
|
||||
|
|
Loading…
Reference in a new issue