mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 14:34:54 +01:00
renamed show_in_logconfig to show_in_dump_config
This commit is contained in:
parent
bc5d891053
commit
5580f93a54
4 changed files with 7 additions and 7 deletions
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -5,5 +5,5 @@ api:
|
|||
- store_yaml.log
|
||||
|
||||
store_yaml:
|
||||
show_in_logconfig: True
|
||||
show_in_dump_config: True
|
||||
show_secrets: True
|
||||
|
|
Loading…
Reference in a new issue