mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 14:38:10 +01:00
Validate project details are set for dashboard_import (#4802)
This commit is contained in:
parent
8822b6c808
commit
97a71482a9
1 changed files with 13 additions and 1 deletions
|
@ -7,9 +7,10 @@ import requests
|
|||
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
import esphome.final_validate as fv
|
||||
from esphome import git
|
||||
from esphome.components.packages import validate_source_shorthand
|
||||
from esphome.const import CONF_REF, CONF_WIFI
|
||||
from esphome.const import CONF_REF, CONF_WIFI, CONF_ESPHOME, CONF_PROJECT
|
||||
from esphome.wizard import wizard_file
|
||||
from esphome.yaml_util import dump
|
||||
|
||||
|
@ -52,6 +53,17 @@ CONFIG_SCHEMA = cv.All(
|
|||
validate_full_url,
|
||||
)
|
||||
|
||||
|
||||
def _final_validate(config):
|
||||
full_config = fv.full_config.get()[CONF_ESPHOME]
|
||||
if CONF_PROJECT not in full_config:
|
||||
raise cv.Invalid(
|
||||
"Dashboard import requires the `esphome` -> `project` information to be provided."
|
||||
)
|
||||
|
||||
|
||||
FINAL_VALIDATE_SCHEMA = _final_validate
|
||||
|
||||
WIFI_CONFIG = """
|
||||
|
||||
wifi:
|
||||
|
|
Loading…
Reference in a new issue