From 6588e9380eb2c1b2bdebf4f9ecf31372ea3b7933 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Sat, 27 Feb 2021 22:47:12 +0100 Subject: [PATCH] Replace substitutions in substitutions first (#1567) --- esphome/components/substitutions/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/substitutions/__init__.py b/esphome/components/substitutions/__init__.py index c4bc1b4371..1cc5b50f47 100644 --- a/esphome/components/substitutions/__init__.py +++ b/esphome/components/substitutions/__init__.py @@ -136,4 +136,6 @@ def do_substitution_pass(config, command_line_substitutions): del substitutions[old] config[CONF_SUBSTITUTIONS] = substitutions + # Move substitutions to the first place to replace substitutions in them correctly + config.move_to_end(CONF_SUBSTITUTIONS, False) _substitute_item(substitutions, config, [])