From 0cac6e8d1b1b5d97948ba4e859a0814c2bfc8c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Ny=C3=ADri?= Date: Sun, 16 Jun 2019 18:09:28 +0200 Subject: [PATCH 01/13] Add: Tavos Water Outage and Atrea ventilation integrations (#108) --- custom_components/hacs/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/hacs/const.py b/custom_components/hacs/const.py index 9d30a710351..245acdcada4 100644 --- a/custom_components/hacs/const.py +++ b/custom_components/hacs/const.py @@ -73,7 +73,7 @@ ################################ DEFAULT_REPOSITORIES = { - "integration": ["StyraHem/ShellyForHASS", "isabellaalstrom/sensor.krisinformation"], + "integration": ["StyraHem/ShellyForHASS", "isabellaalstrom/sensor.krisinformation", "JurajNyiri/HomeAssistant-Tavos", "JurajNyiri/HomeAssistant-Atrea"], "plugin": [ "maykar/compact-custom-header", "maykar/lovelace-swipe-navigation", From 481e2f0ead36c53c2729d45932645f15568a1b17 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Sun, 16 Jun 2019 18:10:48 +0200 Subject: [PATCH 02/13] Format --- custom_components/hacs/const.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/hacs/const.py b/custom_components/hacs/const.py index 245acdcada4..22b2ae50a49 100644 --- a/custom_components/hacs/const.py +++ b/custom_components/hacs/const.py @@ -73,7 +73,12 @@ ################################ DEFAULT_REPOSITORIES = { - "integration": ["StyraHem/ShellyForHASS", "isabellaalstrom/sensor.krisinformation", "JurajNyiri/HomeAssistant-Tavos", "JurajNyiri/HomeAssistant-Atrea"], + "integration": [ + "StyraHem/ShellyForHASS", + "isabellaalstrom/sensor.krisinformation", + "JurajNyiri/HomeAssistant-Tavos", + "JurajNyiri/HomeAssistant-Atrea", + ], "plugin": [ "maykar/compact-custom-header", "maykar/lovelace-swipe-navigation", From ae620130fa8b234f4437839db7968790cfd4c41e Mon Sep 17 00:00:00 2001 From: Tim Soethout Date: Mon, 17 Jun 2019 12:45:13 +0200 Subject: [PATCH 03/13] Adding Goodwe Solar power stats to default repositories (#111) Hi, One of the users of a component I put on Github [asked me](https://github.com/TimSoethout/goodwe-sems-home-assistant/pull/6) to add this component to HACS. I hope this change is correct. --- custom_components/hacs/const.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/hacs/const.py b/custom_components/hacs/const.py index 22b2ae50a49..6e3831ed970 100644 --- a/custom_components/hacs/const.py +++ b/custom_components/hacs/const.py @@ -92,5 +92,6 @@ "thomasloven/lovelace-markdown-mod", "thomasloven/lovelace-slider-entity-row", "isabellaalstrom/krisinfo-card", + "timsoethout/goodwe-sems-home-assistant", ], } From 46594d6b04b0b4908e625ebde2ebd0de8f4de4d1 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Mon, 17 Jun 2019 12:46:53 +0200 Subject: [PATCH 04/13] Move "timsoethout/goodwe-sems-home-assistant", --- custom_components/hacs/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/hacs/const.py b/custom_components/hacs/const.py index 6e3831ed970..08dc3ff9fd3 100644 --- a/custom_components/hacs/const.py +++ b/custom_components/hacs/const.py @@ -78,6 +78,7 @@ "isabellaalstrom/sensor.krisinformation", "JurajNyiri/HomeAssistant-Tavos", "JurajNyiri/HomeAssistant-Atrea", + "timsoethout/goodwe-sems-home-assistant", ], "plugin": [ "maykar/compact-custom-header", @@ -92,6 +93,5 @@ "thomasloven/lovelace-markdown-mod", "thomasloven/lovelace-slider-entity-row", "isabellaalstrom/krisinfo-card", - "timsoethout/goodwe-sems-home-assistant", ], } From 714d62fd33d5539756a577a9c288a59a89f734e5 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Mon, 17 Jun 2019 18:35:12 +0200 Subject: [PATCH 05/13] pin versions --- custom_components/hacs/manifest.json | 2 +- custom_components/hacs/requirements.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 custom_components/hacs/requirements.txt diff --git a/custom_components/hacs/manifest.json b/custom_components/hacs/manifest.json index 6a9e3b7a9ac..40024373138 100644 --- a/custom_components/hacs/manifest.json +++ b/custom_components/hacs/manifest.json @@ -4,5 +4,5 @@ "documentation": "https://custom-components.github.io/hacs", "dependencies": [], "codeowners": ["@ludeeus"], - "requirements": ["aiofiles", "backoff"] + "requirements": ["aiofiles==0.4.0", "backoff==1.8.0"] } \ No newline at end of file diff --git a/custom_components/hacs/requirements.txt b/custom_components/hacs/requirements.txt new file mode 100644 index 00000000000..e6365b97bda --- /dev/null +++ b/custom_components/hacs/requirements.txt @@ -0,0 +1,2 @@ +aiofiles==0.4.0 +backoff==1.8.0 \ No newline at end of file From 0138ec9628f1dcc451702c97c153747672505648 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Tue, 18 Jun 2019 14:25:27 +0200 Subject: [PATCH 06/13] Limit logging --- custom_components/hacs/hacsbase.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/hacs/hacsbase.py b/custom_components/hacs/hacsbase.py index cb4fcff1efb..15ff02562d2 100644 --- a/custom_components/hacs/hacsbase.py +++ b/custom_components/hacs/hacsbase.py @@ -113,7 +113,8 @@ async def register_new_repository(self, element_type, repo, repositoryobject=Non await repository.set_repository() await repository.setup_repository() except (HacsRequirement, HacsBaseException, AIOGitHubException) as exception: - _LOGGER.error("%s - %s", repository.repository_name, exception) + if not self.data["task_running"]: + _LOGGER.error("%s - %s", repository.repository_name, exception) setup_result = False if setup_result: @@ -122,7 +123,8 @@ async def register_new_repository(self, element_type, repo, repositoryobject=Non else: if repo not in self.blacklist: self.blacklist.append(repo) - _LOGGER.error("%s - Could not register.", repo) + if not self.data["task_running"]: + _LOGGER.error("%s - Could not register.", repo) return repository, setup_result async def update_repositories(self, now=None): From f3126e88948204f6c663ede90782b82cc55d44de Mon Sep 17 00:00:00 2001 From: ludeeus Date: Wed, 19 Jun 2019 07:58:52 +0200 Subject: [PATCH 07/13] Fix broken iOS settings --- custom_components/hacs/frontend/elements/hacs.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/hacs/frontend/elements/hacs.css b/custom_components/hacs/frontend/elements/hacs.css index 32717d0ade6..253937e290c 100644 --- a/custom_components/hacs/frontend/elements/hacs.css +++ b/custom_components/hacs/frontend/elements/hacs.css @@ -29,7 +29,7 @@ width: 95%; margin-left: 2.5%; margin-right: 2.5%; - display: flow-root; + display: inline-block; } .hacs-content { From 8b430c3dab2c572c45a2862d5528ebd7d84a9c63 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Wed, 19 Jun 2019 10:26:32 +0200 Subject: [PATCH 08/13] Table text color --- custom_components/hacs/frontend/views/repository.py | 1 - 1 file changed, 1 deletion(-) diff --git a/custom_components/hacs/frontend/views/repository.py b/custom_components/hacs/frontend/views/repository.py index 296ca3fd6d4..c4ceb93e2fc 100644 --- a/custom_components/hacs/frontend/views/repository.py +++ b/custom_components/hacs/frontend/views/repository.py @@ -88,7 +88,6 @@ async def get(self, request, repository_id): info = info.replace("

", "

").replace("
", "") info = info.replace("

", "

").replace("

", "") info = info.replace("", "") - info = info.replace("", "
") info = info.replace( ' Date: Wed, 19 Jun 2019 11:41:48 +0200 Subject: [PATCH 10/13] Adds dev mode --- custom_components/hacs/hacsbase.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/custom_components/hacs/hacsbase.py b/custom_components/hacs/hacsbase.py index 15ff02562d2..00dc9ad1f2f 100644 --- a/custom_components/hacs/hacsbase.py +++ b/custom_components/hacs/hacsbase.py @@ -15,6 +15,7 @@ class HacsBase: """The base class of HACS, nested thoughout the project.""" const = None + dev = False migration = None storage = None hacs = None @@ -182,10 +183,13 @@ async def get_repositories(self): repositories = {} # Get org repositories - repositories["integration"] = await self.aiogithub.get_org_repos( - "custom-components" - ) - repositories["plugin"] = await self.aiogithub.get_org_repos("custom-cards") + if not self.dev: + repositories["integration"] = await self.aiogithub.get_org_repos( + "custom-components" + ) + repositories["plugin"] = await self.aiogithub.get_org_repos("custom-cards") + else: + return [], [] # Additional repositories (Not implemented) for repository_type in DEFAULT_REPOSITORIES: From a158c31591dd852283f16351bc2d8ed4c5c46f4b Mon Sep 17 00:00:00 2001 From: ludeeus Date: Wed, 19 Jun 2019 11:42:12 +0200 Subject: [PATCH 11/13] Parse package.json for author --- .../hacs/hacsrepositorybaseplugin.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/custom_components/hacs/hacsrepositorybaseplugin.py b/custom_components/hacs/hacsrepositorybaseplugin.py index 11cb31c821f..4f850a65c6e 100644 --- a/custom_components/hacs/hacsrepositorybaseplugin.py +++ b/custom_components/hacs/hacsrepositorybaseplugin.py @@ -1,6 +1,7 @@ """Blueprint for HacsRepositoryPlugin.""" # pylint: disable=too-many-instance-attributes,invalid-name,broad-except import logging +import json from .aiogithub import AIOGitHubException from .blueprints import HacsRepositoryBase @@ -58,8 +59,15 @@ async def update(self): except AIOGitHubException: # This can fail, no big deal. pass + await self.set_repository_content() + try: + await self.get_package_content() + except AIOGitHubException: + # This can fail, no big deal. + pass + async def set_repository_content(self): """Set repository content attributes.""" if self.content_path is None or self.content_path == "": @@ -126,3 +134,13 @@ async def set_repository_content(self): if not self.content_files or not self.content_objects: raise HacsRequirement("No acceptable js files found") + + async def get_package_content(self): + """Get package content.""" + package = None + + package = await self.repository.get_contents("package.json") + package = json.loads(package.content) + + if package: + self.authors = package["author"] From 2feabe9e010ee07beb13df508471005e9181e190 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Wed, 19 Jun 2019 11:42:34 +0200 Subject: [PATCH 12/13] Pretty names for plugins --- .../hacs/frontend/views/overview.py | 4 +++- .../hacs/frontend/views/repository.py | 21 +++++++++++-------- .../hacs/frontend/views/store.py | 4 +++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/custom_components/hacs/frontend/views/overview.py b/custom_components/hacs/frontend/views/overview.py index 7f44a2ebc70..3bf3dabd955 100644 --- a/custom_components/hacs/frontend/views/overview.py +++ b/custom_components/hacs/frontend/views/overview.py @@ -60,6 +60,7 @@ async def get(self, request): # pylint: disable=unused-argument
+ {} {}

{}

@@ -71,8 +72,9 @@ async def get(self, request): # pylint: disable=unused-argument repository.repository_id, repository.topics, repository.authors, - card_icon, repository.name, + card_icon, + repository.name.replace('-', ' ').title(), repository.description, ) diff --git a/custom_components/hacs/frontend/views/repository.py b/custom_components/hacs/frontend/views/repository.py index c4ceb93e2fc..23e3161c2f9 100644 --- a/custom_components/hacs/frontend/views/repository.py +++ b/custom_components/hacs/frontend/views/repository.py @@ -100,14 +100,17 @@ async def get(self, request, repository_id): info = "" if repository.authors: - authors = "

Author(s): " - for author in repository.authors: - if "@" in author: - author = author.split("@")[-1] - authors += " @{author}".format( - author=author - ) - authors += "

" + if repository.repository_type == "integration": + authors = "

Author(s): " + for author in repository.authors: + if "@" in author: + author = author.split("@")[-1] + authors += " @{author}".format( + author=author + ) + authors += "

" + else: + authors = "

Author: {}

".format(repository.authors) else: authors = "" @@ -284,7 +287,7 @@ async def get(self, request, repository_id): """.format( custom_message, pending_restart, - repository.name, + repository.name.replace('-', ' ').title(), self.url_path["api"], repository.repository_id, hide_option, diff --git a/custom_components/hacs/frontend/views/store.py b/custom_components/hacs/frontend/views/store.py index 35d5365bf3f..110a094a1dd 100644 --- a/custom_components/hacs/frontend/views/store.py +++ b/custom_components/hacs/frontend/views/store.py @@ -61,6 +61,7 @@ async def get(self, request): # pylint: disable=unused-argument
+ {} {}

{}

@@ -72,8 +73,9 @@ async def get(self, request): # pylint: disable=unused-argument repository.repository_id, repository.topics, repository.authors, - card_icon, repository.name, + card_icon, + repository.name.replace('-', ' ').title(), repository.description, ) From fbc5d9dbeda1d2a803c8cc49ae67d3505f83d44e Mon Sep 17 00:00:00 2001 From: ludeeus Date: Wed, 19 Jun 2019 12:48:00 +0200 Subject: [PATCH 13/13] Version bump --- custom_components/hacs/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/hacs/const.py b/custom_components/hacs/const.py index 6e4e5b356a0..3d30e6fbd5c 100644 --- a/custom_components/hacs/const.py +++ b/custom_components/hacs/const.py @@ -1,5 +1,5 @@ """Constants for HACS""" -VERSION = "0.8.1" +VERSION = "0.9.0" NAME_LONG = "HACS (Home Assistant Community Store)" NAME_SHORT = "HACS" STORAGE_VERSION = "1"