diff --git a/esphome/components/store_yaml/__init__.py b/esphome/components/store_yaml/__init__.py index bc73db77ea..52b833a2a8 100644 --- a/esphome/components/store_yaml/__init__.py +++ b/esphome/components/store_yaml/__init__.py @@ -1,7 +1,9 @@ +import copy import esphome.codegen as cg import esphome.config_validation as cv from esphome import automation, yaml_util from esphome.core import CORE +from esphome.config import strip_default_ids from esphome.const import ( CONF_ID, @@ -27,7 +29,7 @@ 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_dump_config(config[CONF_SHOW_IN_DUMP_CONFIG])) - yaml = yaml_util.load_yaml(CORE.config_path) + yaml = strip_default_ids(copy.deepcopy(CORE.config)) dump = yaml_util.dump(yaml, show_secrets=config[CONF_SHOW_SECRETS]) cg.add(store_yaml.set_yaml(dump))