mirror of
https://github.com/home-assistant/core.git
synced 2025-05-03 13:39:16 +00:00
Z-Wave config panel fix (#6113)
This commit is contained in:
parent
2cc6fe6609
commit
b969fea900
@ -74,5 +74,5 @@ def _read(path):
|
|||||||
|
|
||||||
def _write(path, data):
|
def _write(path, data):
|
||||||
"""Write YAML helper."""
|
"""Write YAML helper."""
|
||||||
with open(path, 'w') as outfile:
|
with open(path, 'w', encoding='utf-8') as outfile:
|
||||||
dump(data, outfile)
|
outfile.write(dump(data))
|
||||||
|
@ -69,9 +69,9 @@ def load_yaml(fname: str) -> Union[List, Dict]:
|
|||||||
raise HomeAssistantError(exc)
|
raise HomeAssistantError(exc)
|
||||||
|
|
||||||
|
|
||||||
def dump(_dict: dict, outfile=None) -> str:
|
def dump(_dict: dict) -> str:
|
||||||
"""Dump yaml to a string and remove null."""
|
"""Dump yaml to a string and remove null."""
|
||||||
return yaml.safe_dump(_dict, outfile, default_flow_style=False) \
|
return yaml.safe_dump(_dict, default_flow_style=False) \
|
||||||
.replace(': null\n', ':\n')
|
.replace(': null\n', ':\n')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user