File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 2222from homeassistant .setup import async_get_loaded_integrations
2323from jinja2 import Template
2424
25+
2526from .const import DOMAIN , DOMAIN_DATA , LOGGER , STARTUP_MESSAGE
2627
2728CONFIG_SCHEMA = vol .Schema (
@@ -150,7 +151,7 @@ async def service_generate(_call):
150151 await convert_lovelace (hass )
151152
152153 custom_components = await get_custom_integrations (hass )
153- hacs_components = get_hacs_components ()
154+ hacs_components = get_hacs_components (hass )
154155
155156 variables = {
156157 "custom_components" : custom_components ,
@@ -170,21 +171,17 @@ async def service_generate(_call):
170171 hass .services .async_register (DOMAIN , "generate" , service_generate )
171172
172173
173- def get_hacs_components ():
174- try :
175- from custom_components .hacs .share import get_hacs
176- except ImportError :
174+ def get_hacs_components (hass : HomeAssistant ):
175+ if (hacs := hass .data .get ("hacs" )) is None :
177176 return []
178177
179- hacs = get_hacs ()
180-
181178 return [
182179 {
183180 ** repo .data .to_json (),
184181 "name" : get_repository_name (repo ),
185182 "documentation" : f"https://github.com/{ repo .data .full_name } " ,
186183 }
187- for repo in hacs .repositories or [] if repo . data . installed
184+ for repo in hacs .repositories . list_downloaded or []
188185 ]
189186
190187
Original file line number Diff line number Diff line change 55 "filename" : " readme.zip" ,
66 "homeassistant" : " 2021.5.0" ,
77 "hide_default_branch" : true ,
8- "render_readme" : true
8+ "render_readme" : true ,
9+ "hacs" : " 0.19.1"
910}
You can’t perform that action at this time.
0 commit comments