From 20c307acc4d77fb3f58c2d4acd63b9a1e03be326 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 30 Nov 2018 12:40:33 +0100 Subject: [PATCH] Fix substitutions --- esphomeyaml/components/substitutions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphomeyaml/components/substitutions.py b/esphomeyaml/components/substitutions.py index c126360b89..fc855c2fdc 100644 --- a/esphomeyaml/components/substitutions.py +++ b/esphomeyaml/components/substitutions.py @@ -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(