diff --git a/esphome/components/store_yaml/__init__.py b/esphome/components/store_yaml/__init__.py index b2d40ac93e..bc73db77ea 100644 --- a/esphome/components/store_yaml/__init__.py +++ b/esphome/components/store_yaml/__init__.py @@ -8,7 +8,7 @@ from esphome.const import ( ) CODEOWNERS = ["@gabest11"] -CONF_SHOW_IN_LOGCONFIG = "show_in_logconfig" +CONF_SHOW_IN_DUMP_CONFIG = "show_in_dump_config" CONF_SHOW_SECRETS = "show_secrets" store_yaml_ns = cg.esphome_ns.namespace("store_yaml") @@ -17,7 +17,7 @@ StoreYamlComponent = store_yaml_ns.class_("StoreYamlComponent", cg.Component) CONFIG_SCHEMA = cv.Schema( { cv.GenerateID(): cv.declare_id(StoreYamlComponent), - cv.Optional(CONF_SHOW_IN_LOGCONFIG, default=True): cv.boolean, + cv.Optional(CONF_SHOW_IN_DUMP_CONFIG, default=True): cv.boolean, cv.Optional(CONF_SHOW_SECRETS, default=False): cv.boolean, } ) @@ -26,7 +26,7 @@ CONFIG_SCHEMA = cv.Schema( async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) store_yaml = await cg.register_component(var, config) - cg.add(store_yaml.set_show_in_logconfig(config[CONF_SHOW_IN_LOGCONFIG])) + cg.add(store_yaml.set_show_in_dump_config(config[CONF_SHOW_IN_DUMP_CONFIG])) yaml = yaml_util.load_yaml(CORE.config_path) dump = yaml_util.dump(yaml, show_secrets=config[CONF_SHOW_SECRETS]) cg.add(store_yaml.set_yaml(dump)) diff --git a/esphome/components/store_yaml/store_yaml.cpp b/esphome/components/store_yaml/store_yaml.cpp index 5d2ebd5afe..d7d8020ccc 100644 --- a/esphome/components/store_yaml/store_yaml.cpp +++ b/esphome/components/store_yaml/store_yaml.cpp @@ -7,7 +7,7 @@ namespace store_yaml { static const char *const TAG = "store_yaml"; void StoreYamlComponent::dump_config() { - if (this->show_) { + if (this->show_in_dump_config_) { ESP_LOGCONFIG(TAG, "YAML:"); this->log(true); } diff --git a/esphome/components/store_yaml/store_yaml.h b/esphome/components/store_yaml/store_yaml.h index c437f28b01..989095805b 100644 --- a/esphome/components/store_yaml/store_yaml.h +++ b/esphome/components/store_yaml/store_yaml.h @@ -6,12 +6,12 @@ namespace esphome { namespace store_yaml { class StoreYamlComponent : public Component { - bool show_{false}; + bool show_in_dump_config_{false}; std::string yaml_; public: void dump_config() override; - void set_show_in_logconfig(bool show) { this->show_ = show; } + void set_show_in_dump_config(bool show) { this->show_in_dump_config_ = show; } void set_yaml(const std::string &yaml) { this->yaml_ = yaml; } std::string get_yaml() const; void log(bool dump_config = false) const; diff --git a/tests/components/store_yaml/common.yaml b/tests/components/store_yaml/common.yaml index 3083f008c0..6e991bcd13 100644 --- a/tests/components/store_yaml/common.yaml +++ b/tests/components/store_yaml/common.yaml @@ -5,5 +5,5 @@ api: - store_yaml.log store_yaml: - show_in_logconfig: True + show_in_dump_config: True show_secrets: True