From 9ed06444e168bb754f81ba3cfc2dbd34fd48c7d2 Mon Sep 17 00:00:00 2001 From: Pavel Pletenev Date: Sun, 26 May 2019 11:28:46 +0300 Subject: [PATCH] Suggested fix for empty domain (#555) * Suggested fix for empty domain Signed-off-by: delphi * Added proposed changes Signed-off-by: delphi --- esphome/config.py | 4 +++- tests/test2.yaml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/esphome/config.py b/esphome/config.py index ac22db37ad..debd261b41 100644 --- a/esphome/config.py +++ b/esphome/config.py @@ -450,7 +450,9 @@ def validate_config(config): result.remove_output_path([domain], domain) # Ensure conf is a list - if not isinstance(conf, list) and conf: + if not conf: + result[domain] = conf = [] + elif not isinstance(conf, list): result[domain] = conf = [conf] for i, p_config in enumerate(conf): diff --git a/tests/test2.yaml b/tests/test2.yaml index 2b7ddebf3c..e3a9b0da85 100644 --- a/tests/test2.yaml +++ b/tests/test2.yaml @@ -238,3 +238,6 @@ interval: interval: 5s then: - logger.log: "Interval Run" + +display: +