Z-Wave config panel fix (#6113)

pull/6119/head
Paulus Schoutsen 2017-02-19 22:25:03 -08:00 committed by GitHub
parent 2cc6fe6609
commit b969fea900
2 changed files with 4 additions and 4 deletions

View File

@ -74,5 +74,5 @@ def _read(path):
def _write(path, data):
"""Write YAML helper."""
with open(path, 'w') as outfile:
dump(data, outfile)
with open(path, 'w', encoding='utf-8') as outfile:
outfile.write(dump(data))

View File

@ -69,9 +69,9 @@ def load_yaml(fname: str) -> Union[List, Dict]:
raise HomeAssistantError(exc)
def dump(_dict: dict, outfile=None) -> str:
def dump(_dict: dict) -> str:
"""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')