1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-22 21:22:22 +01:00

Fix-esphome-validation-line-number (#3815)

This commit is contained in:
Guillermo Ruffino
2022-09-20 02:23:55 -03:00
committed by GitHub
parent b2db524366
commit 1444cddda9
3 changed files with 23 additions and 9 deletions

View File

@@ -179,7 +179,11 @@ def preload_core_config(config, result):
]
if not has_oldstyle and not newstyle_found:
raise cv.Invalid("Platform missing for core options!", [CONF_ESPHOME])
raise cv.Invalid(
"Platform missing. You must include one of the available platform keys: "
+ ", ".join(TARGET_PLATFORMS),
[CONF_ESPHOME],
)
if has_oldstyle and newstyle_found:
raise cv.Invalid(
f"Please remove the `platform` key from the [esphome] block. You're already using the new style with the [{conf[CONF_PLATFORM]}] block",