1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 11:52:20 +01:00

Add validate to components (#1631)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Guillermo Ruffino
2021-05-30 19:06:45 -03:00
committed by GitHub
parent 482a3aebc9
commit c79d700d03
16 changed files with 174 additions and 36 deletions

View File

@@ -137,7 +137,7 @@ WIFI_NETWORK_STA = WIFI_NETWORK_BASE.extend(
)
def validate(config):
def _validate(config):
if CONF_PASSWORD in config and CONF_SSID not in config:
raise cv.Invalid("Cannot have WiFi password without SSID!")
@@ -207,7 +207,7 @@ CONFIG_SCHEMA = cv.All(
),
}
),
validate,
_validate,
)