Updated HACS and also fixed Garadget #727

This commit is contained in:
ccostan
2020-04-09 21:29:27 -04:00
parent 51aab60dea
commit e6e0d442e9
65 changed files with 1510 additions and 1047 deletions

23
config/custom_components/hacs/helpers/misc.py Executable file → Normal file
View 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: