This kind of AUTO_LOAD should pass the test, a few other components do conditional auto-loading this way.

This commit is contained in:
Gábor Poczkodi 2024-11-12 22:47:09 +01:00
parent a042bfc9ba
commit ee3aa6ab91
2 changed files with 13 additions and 7 deletions

View file

@ -24,8 +24,14 @@ platforms = [
]
CODEOWNERS = ["@gabest11"]
if CORE.target_platform in platforms:
AUTO_LOAD = ["web_server_base"]
def AUTO_LOAD():
if CORE.target_platform in platforms:
return ["web_server_base"]
return []
CONF_SHOW_IN_DUMP_CONFIG = "show_in_dump_config"
CONF_SHOW_SECRETS = "show_secrets"
CONF_HTTP = "http"

View file

@ -8,13 +8,13 @@ namespace store_yaml {
static const char *const TAG = "store_yaml";
void StoreYamlComponent::dump_config() {
if (this->show_in_dump_config_) {
ESP_LOGCONFIG(TAG, "YAML:");
ESP_LOGCONFIG(TAG, " Compressed size: %zu", ESPHOME_YAML_SIZE);
ESP_LOGCONFIG(TAG, "YAML:");
ESP_LOGCONFIG(TAG, " Compressed size: %zu", ESPHOME_YAML_SIZE);
#ifndef USE_RP2040
const char *url = (this->web_server_ != nullptr) ? this->web_server_url_.c_str() : "not configured!";
ESP_LOGCONFIG(TAG, " Web server url: %s", url);
const char *url = (this->web_server_ != nullptr) ? this->web_server_url_.c_str() : "not configured!";
ESP_LOGCONFIG(TAG, " Web server url: %s", url);
#endif
if (this->show_in_dump_config_) {
RowDecompressor dec(ESPHOME_YAML, ESPHOME_YAML_SIZE);
std::string row;
while (dec.get_row(row)) {