[logger] Don't allow `logger.log actions without configuring the logger` (#9821)

This commit is contained in:
Jesse Hills 2025-07-26 16:23:36 +12:00 committed by GitHub
parent b6e0188c42
commit 6d37b916dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -421,6 +421,7 @@ CONF_LOGGER_LOG = "logger.log"
LOGGER_LOG_ACTION_SCHEMA = cv.All(
cv.maybe_simple_value(
{
cv.GenerateID(CONF_LOGGER_ID): cv.use_id(Logger),
cv.Required(CONF_FORMAT): cv.string,
cv.Optional(CONF_ARGS, default=list): cv.ensure_list(cv.lambda_),
cv.Optional(CONF_LEVEL, default="DEBUG"): cv.one_of(

View File

@ -4,6 +4,8 @@ esphome:
esp32:
board: esp32dev
logger:
text:
- platform: template
name: "test 1 text"