mirror of
https://github.com/esphome/esphome.git
synced 2025-01-03 19:31:46 +01:00
Fix substitutions
This commit is contained in:
parent
5e3bc4ed2b
commit
20c307acc4
1 changed files with 2 additions and 2 deletions
|
@ -19,10 +19,10 @@ def validate_substitution_key(value):
|
|||
value = cv.string(value)
|
||||
if not value:
|
||||
raise vol.Invalid("Substitution key must not be empty")
|
||||
if value[0].isdigit():
|
||||
raise vol.Invalid("First character in substitutions cannot be a digit.")
|
||||
if value[0] == '$':
|
||||
value = value[1:]
|
||||
if value[0].isdigit():
|
||||
raise vol.Invalid("First character in substitutions cannot be a digit.")
|
||||
for char in value:
|
||||
if char not in VALID_SUBSTITUTIONS_CHARACTERS:
|
||||
raise vol.Invalid(
|
||||
|
|
Loading…
Reference in a new issue