diff --git a/esphome/components/logger/__init__.py b/esphome/components/logger/__init__.py index 0140d0889ce..da5f2a38cb7 100644 --- a/esphome/components/logger/__init__.py +++ b/esphome/components/logger/__init__.py @@ -220,6 +220,13 @@ def validate_local_no_higher_than_global(config: ConfigType) -> ConfigType: [CONF_BOOT_LOG_LEVEL], ) ) + if config[CONF_BOOT_LOGS] and config[CONF_BOOT_LOG_BUFFER_SIZE] == 0: + errs.append( + cv.Invalid( + "boot_logs has no effect without boot_log_buffer_size", + [CONF_BOOT_LOGS], + ) + ) if errs: raise cv.MultipleInvalid(errs) return config diff --git a/tests/components/logger/test-boot_log_buffer.esp8266-ard.yaml b/tests/components/logger/test-boot_log_buffer.esp8266-ard.yaml index ba51773cdb9..da57ff18095 100644 --- a/tests/components/logger/test-boot_log_buffer.esp8266-ard.yaml +++ b/tests/components/logger/test-boot_log_buffer.esp8266-ard.yaml @@ -9,3 +9,5 @@ esphome: logger: id: logger_id boot_log_buffer_size: 2kB + boot_logs: + wifi: DEBUG