add validate modem input config

This commit is contained in:
Chelios 2024-10-19 08:47:27 +03:00 committed by Alexandr Pyslar
parent 6da178091b
commit 5380e921d1

View file

@ -45,7 +45,8 @@ def _validate(config):
return config
CONFIG_SCHEMA = cv.Schema(
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(ModemComponent),
cv.Required(CONF_TYPE): cv.enum(MODEM_TYPES, upper=True),
@ -65,7 +66,9 @@ CONFIG_SCHEMA = cv.Schema(
cv.Optional(CONF_DOMAIN, default=".local"): cv.domain_name,
cv.Optional(CONF_USE_ADDRESS): cv.string_strict,
}
).extend(cv.COMPONENT_SCHEMA)
).extend(cv.COMPONENT_SCHEMA),
_validate,
)
@coroutine_with_priority(60.0)