mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-09-14 15:51:02 +00:00
Updated HACS and also fixed Garadget #727
This commit is contained in:
29
config/custom_components/hacs/globals.py
Normal file
29
config/custom_components/hacs/globals.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# pylint: disable=invalid-name, missing-docstring
|
||||
hacs = []
|
||||
removed_repositories = []
|
||||
|
||||
|
||||
def get_hacs():
|
||||
if not hacs:
|
||||
from custom_components.hacs.hacsbase import Hacs
|
||||
|
||||
hacs.append(Hacs())
|
||||
|
||||
return hacs[0]
|
||||
|
||||
|
||||
def is_removed(repository):
|
||||
return repository in [x.repository for x in removed_repositories]
|
||||
|
||||
|
||||
def get_removed(repository):
|
||||
if not is_removed(repository):
|
||||
from custom_components.hacs.repositories.removed import RemovedRepository
|
||||
|
||||
removed_repo = RemovedRepository()
|
||||
removed_repo.repository = repository
|
||||
removed_repositories.append(removed_repo)
|
||||
filter_repos = [
|
||||
x for x in removed_repositories if x.repository.lower() == repository.lower()
|
||||
]
|
||||
return filter_repos[0]
|
Reference in New Issue
Block a user