From 4a89a475bd74b511b95d392a8745c9f8c40d5bd0 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 2 Jun 2019 15:26:44 +0200 Subject: [PATCH] Add better esphomeyaml migration path (#600) Fixes https://github.com/esphome/issues/issues/387 --- esphome/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/esphome/config.py b/esphome/config.py index 9b34d53200..b5075e5e84 100644 --- a/esphome/config.py +++ b/esphome/config.py @@ -393,6 +393,16 @@ def validate_config(config): result.add_error(err) return result + if 'esphomeyaml' in config: + _LOGGER.warning("The esphomeyaml section has been renamed to esphome in 1.11.0. " + "Please replace 'esphomeyaml:' in your configuration with 'esphome:'.") + config[CONF_ESPHOME] = config.pop('esphomeyaml') + + if CONF_ESPHOME not in config: + result.add_str_error("'esphome' section missing from configuration. Please make sure " + "your configuration has an 'esphome:' line in it.", []) + return result + # 2. Load partial core config result[CONF_ESPHOME] = config[CONF_ESPHOME] result.add_output_path([CONF_ESPHOME], CONF_ESPHOME)