Skip to content

Commit ee259a4

Browse files
authored
Fix issues with files generation (#13)
1 parent a4e5587 commit ee259a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

custom_components/readme/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async def convert_lovelace(hass: HomeAssistant):
9999
"""Convert the lovelace configuration."""
100100
if os.path.exists(hass.config.path(".storage/lovelace")):
101101
content = (
102-
json.loads(read_file(hass, ".storage/lovelace") or {})
102+
json.loads(await read_file(hass, ".storage/lovelace") or {})
103103
.get("data", {})
104104
.get("config", {})
105105
)
@@ -131,7 +131,7 @@ async def write_file(
131131
def write():
132132
with open(hass.config.path(path), "w") as open_file:
133133
if as_yaml:
134-
yaml.dump(content, open_file, default_flow_style=False)
134+
yaml.dump(content, open_file, default_flow_style=False, allow_unicode=True)
135135
else:
136136
open_file.write(content)
137137

@@ -147,7 +147,7 @@ async def service_generate(_call):
147147
if hass.data[DOMAIN_DATA].get("convert") or hass.data[DOMAIN_DATA].get(
148148
"convert_lovelace"
149149
):
150-
convert_lovelace(hass)
150+
await convert_lovelace(hass)
151151

152152
custom_components = await get_custom_integrations(hass)
153153
hacs_components = get_hacs_components()
@@ -184,7 +184,7 @@ def get_hacs_components():
184184
"name": get_repository_name(repo),
185185
"documentation": f"https://github.com/{repo.data.full_name}",
186186
}
187-
for repo in hacs.repositories or []
187+
for repo in hacs.repositories or [] if repo.data.installed
188188
]
189189

190190

0 commit comments

Comments
 (0)