mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-15 18:15:00 +00:00
Updated HACS and also fixed Garadget #727
This commit is contained in:
23
config/custom_components/hacs/helpers/misc.py
Executable file → Normal file
23
config/custom_components/hacs/helpers/misc.py
Executable file → Normal file
@@ -2,20 +2,23 @@
|
||||
import semantic_version
|
||||
|
||||
|
||||
def get_repository_name(
|
||||
hacs_manifest, repository_name: str, category: str = None, manifest: dict = None
|
||||
) -> str:
|
||||
def get_repository_name(repository) -> str:
|
||||
"""Return the name of the repository for use in the frontend."""
|
||||
|
||||
if hacs_manifest.name is not None:
|
||||
return hacs_manifest.name
|
||||
if repository.repository_manifest.name is not None:
|
||||
return repository.repository_manifest.name
|
||||
|
||||
if category == "integration":
|
||||
if manifest:
|
||||
if "name" in manifest:
|
||||
return manifest["name"]
|
||||
if repository.data.category == "integration":
|
||||
if repository.integration_manifest:
|
||||
if "name" in repository.integration_manifest:
|
||||
return repository.integration_manifest["name"]
|
||||
|
||||
return repository_name.replace("-", " ").replace("_", " ").title()
|
||||
return (
|
||||
repository.data.full_name.split("/")[-1]
|
||||
.replace("-", " ")
|
||||
.replace("_", " ")
|
||||
.title()
|
||||
)
|
||||
|
||||
|
||||
def version_left_higher_then_right(new: str, old: str) -> bool:
|
||||
|
Reference in New Issue
Block a user