1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-27 15:42:22 +01:00

Dump full parsed config to json-config api call (#4373)

This commit is contained in:
Jesse Hills
2023-02-01 16:59:51 +13:00
committed by GitHub
parent d4a8df04b8
commit e847766514
3 changed files with 30 additions and 14 deletions

View File

@@ -390,8 +390,11 @@ def _load_yaml_internal(fname):
loader.dispose()
def dump(dict_):
def dump(dict_, show_secrets=False):
"""Dump YAML to a string and remove null."""
if show_secrets:
_SECRET_VALUES.clear()
_SECRET_CACHE.clear()
return yaml.dump(
dict_, default_flow_style=False, allow_unicode=True, Dumper=ESPHomeDumper
)