From ff334eeb8e5aa002c021ba06365eead8cf71cf5a Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:22:08 +0100 Subject: [PATCH 1/7] Directory structure for HACS --- README.md | 6 +++--- .../button_plus/__init__.py | 0 .../button_plus/button.py | 0 .../button_plus_api}/RGBColorConverter.py | 0 .../button_plus/button_plus_api}/__init__.py | 0 .../button_plus/button_plus_api}/api_client.py | 0 .../button_plus_api}/local_api_client.py | 0 .../button_plus/button_plus_api}/model.py | 0 .../button_plus/buttonplushub.py | 0 .../button_plus/config_flow.py | 0 const.py => custom_components/button_plus/const.py | 0 .../button_plus/coordinator.py | 0 light.py => custom_components/button_plus/light.py | 0 .../button_plus/manifest.json | 0 .../button_plus/resource}/config.json.notes | 0 .../button_plus/resource}/physicalconfig.json | 0 .../button_plus/resource}/physicalconfig1.07.json | 0 .../button_plus/resource}/push config.txt | 0 .../button_plus/resource}/virtualconfig.json | 0 .../button_plus/sensor.py | 0 .../button_plus/switch.py | 0 text.py => custom_components/button_plus/text.py | 0 .../button_plus/translations}/en.json | 0 resource/img.png => img.png | Bin 24 files changed, 3 insertions(+), 3 deletions(-) rename __init__.py => custom_components/button_plus/__init__.py (100%) rename button.py => custom_components/button_plus/button.py (100%) rename {button_plus_api => custom_components/button_plus/button_plus_api}/RGBColorConverter.py (100%) rename {button_plus_api => custom_components/button_plus/button_plus_api}/__init__.py (100%) rename {button_plus_api => custom_components/button_plus/button_plus_api}/api_client.py (100%) rename {button_plus_api => custom_components/button_plus/button_plus_api}/local_api_client.py (100%) rename {button_plus_api => custom_components/button_plus/button_plus_api}/model.py (100%) rename buttonplushub.py => custom_components/button_plus/buttonplushub.py (100%) rename config_flow.py => custom_components/button_plus/config_flow.py (100%) rename const.py => custom_components/button_plus/const.py (100%) rename coordinator.py => custom_components/button_plus/coordinator.py (100%) rename light.py => custom_components/button_plus/light.py (100%) rename manifest.json => custom_components/button_plus/manifest.json (100%) rename {resource => custom_components/button_plus/resource}/config.json.notes (100%) rename {resource => custom_components/button_plus/resource}/physicalconfig.json (100%) rename {resource => custom_components/button_plus/resource}/physicalconfig1.07.json (100%) rename {resource => custom_components/button_plus/resource}/push config.txt (100%) rename {resource => custom_components/button_plus/resource}/virtualconfig.json (100%) rename sensor.py => custom_components/button_plus/sensor.py (100%) rename switch.py => custom_components/button_plus/switch.py (100%) rename text.py => custom_components/button_plus/text.py (100%) rename {translations => custom_components/button_plus/translations}/en.json (100%) rename resource/img.png => img.png (100%) diff --git a/README.md b/README.md index 072a666..687ce82 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Button+ integration for Home Assistant -![img.png](resource%2Fimg.png) -This integration allows you to setup and control your Button+ device from Home Assistant. +![img.png](img.png) +This integration allows you to set up and control your Button+ device from Home Assistant. -Currently this project is in development and **highly** unstable. +Currently, this project is in development and **highly** unstable. ## Documentation diff --git a/__init__.py b/custom_components/button_plus/__init__.py similarity index 100% rename from __init__.py rename to custom_components/button_plus/__init__.py diff --git a/button.py b/custom_components/button_plus/button.py similarity index 100% rename from button.py rename to custom_components/button_plus/button.py diff --git a/button_plus_api/RGBColorConverter.py b/custom_components/button_plus/button_plus_api/RGBColorConverter.py similarity index 100% rename from button_plus_api/RGBColorConverter.py rename to custom_components/button_plus/button_plus_api/RGBColorConverter.py diff --git a/button_plus_api/__init__.py b/custom_components/button_plus/button_plus_api/__init__.py similarity index 100% rename from button_plus_api/__init__.py rename to custom_components/button_plus/button_plus_api/__init__.py diff --git a/button_plus_api/api_client.py b/custom_components/button_plus/button_plus_api/api_client.py similarity index 100% rename from button_plus_api/api_client.py rename to custom_components/button_plus/button_plus_api/api_client.py diff --git a/button_plus_api/local_api_client.py b/custom_components/button_plus/button_plus_api/local_api_client.py similarity index 100% rename from button_plus_api/local_api_client.py rename to custom_components/button_plus/button_plus_api/local_api_client.py diff --git a/button_plus_api/model.py b/custom_components/button_plus/button_plus_api/model.py similarity index 100% rename from button_plus_api/model.py rename to custom_components/button_plus/button_plus_api/model.py diff --git a/buttonplushub.py b/custom_components/button_plus/buttonplushub.py similarity index 100% rename from buttonplushub.py rename to custom_components/button_plus/buttonplushub.py diff --git a/config_flow.py b/custom_components/button_plus/config_flow.py similarity index 100% rename from config_flow.py rename to custom_components/button_plus/config_flow.py diff --git a/const.py b/custom_components/button_plus/const.py similarity index 100% rename from const.py rename to custom_components/button_plus/const.py diff --git a/coordinator.py b/custom_components/button_plus/coordinator.py similarity index 100% rename from coordinator.py rename to custom_components/button_plus/coordinator.py diff --git a/light.py b/custom_components/button_plus/light.py similarity index 100% rename from light.py rename to custom_components/button_plus/light.py diff --git a/manifest.json b/custom_components/button_plus/manifest.json similarity index 100% rename from manifest.json rename to custom_components/button_plus/manifest.json diff --git a/resource/config.json.notes b/custom_components/button_plus/resource/config.json.notes similarity index 100% rename from resource/config.json.notes rename to custom_components/button_plus/resource/config.json.notes diff --git a/resource/physicalconfig.json b/custom_components/button_plus/resource/physicalconfig.json similarity index 100% rename from resource/physicalconfig.json rename to custom_components/button_plus/resource/physicalconfig.json diff --git a/resource/physicalconfig1.07.json b/custom_components/button_plus/resource/physicalconfig1.07.json similarity index 100% rename from resource/physicalconfig1.07.json rename to custom_components/button_plus/resource/physicalconfig1.07.json diff --git a/resource/push config.txt b/custom_components/button_plus/resource/push config.txt similarity index 100% rename from resource/push config.txt rename to custom_components/button_plus/resource/push config.txt diff --git a/resource/virtualconfig.json b/custom_components/button_plus/resource/virtualconfig.json similarity index 100% rename from resource/virtualconfig.json rename to custom_components/button_plus/resource/virtualconfig.json diff --git a/sensor.py b/custom_components/button_plus/sensor.py similarity index 100% rename from sensor.py rename to custom_components/button_plus/sensor.py diff --git a/switch.py b/custom_components/button_plus/switch.py similarity index 100% rename from switch.py rename to custom_components/button_plus/switch.py diff --git a/text.py b/custom_components/button_plus/text.py similarity index 100% rename from text.py rename to custom_components/button_plus/text.py diff --git a/translations/en.json b/custom_components/button_plus/translations/en.json similarity index 100% rename from translations/en.json rename to custom_components/button_plus/translations/en.json diff --git a/resource/img.png b/img.png similarity index 100% rename from resource/img.png rename to img.png From d616b589385cf7a158405074e74cdb4a09a2be9d Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:22:24 +0100 Subject: [PATCH 2/7] Add MQTT as dependency --- custom_components/button_plus/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/button_plus/manifest.json b/custom_components/button_plus/manifest.json index 69ad53f..46df13f 100644 --- a/custom_components/button_plus/manifest.json +++ b/custom_components/button_plus/manifest.json @@ -5,7 +5,7 @@ "@koenhendriks" ], "config_flow": true, - "dependencies": [], + "dependencies": ["mqtt"], "documentation": "https://github.com/koenhendriks/ha-button-plus", "homekit": {}, "iot_class": "local_push", From 153263d9ac9031261bf116c57fcf13e6b6618d46 Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:33:40 +0100 Subject: [PATCH 3/7] Set alpha version. --- custom_components/button_plus/manifest.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/button_plus/manifest.json b/custom_components/button_plus/manifest.json index 46df13f..7869e44 100644 --- a/custom_components/button_plus/manifest.json +++ b/custom_components/button_plus/manifest.json @@ -7,11 +7,12 @@ "config_flow": true, "dependencies": ["mqtt"], "documentation": "https://github.com/koenhendriks/ha-button-plus", + "issue_tracker": "https://github.com/koenhendriks/ha-button-plus/issues", "homekit": {}, "iot_class": "local_push", "integration_type": "hub", "requirements": [ ], - "version": "0.1.0", + "version": "0.0.1", "zeroconf": [] } From de96708197cc8d94deceb49c4906a718af70f7ff Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:46:39 +0100 Subject: [PATCH 4/7] Setup validation CI for hacs and hassfest. --- .github/workflows/validate.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..812cfe1 --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,23 @@ +name: Validate + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + validate-hacs: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - name: HACS validation + uses: "hacs/action@main" + with: + category: "integration" + + validate-hassfest: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - name: Hassfest validation + - uses: home-assistant/actions/hassfest@master From b608c194d73ef0a0e5e4e7dc8fd4642a4bcb8e51 Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:46:57 +0100 Subject: [PATCH 5/7] Added initial HACS json --- custom_components/hacs.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 custom_components/hacs.json diff --git a/custom_components/hacs.json b/custom_components/hacs.json new file mode 100644 index 0000000..0bef404 --- /dev/null +++ b/custom_components/hacs.json @@ -0,0 +1,9 @@ +{ + "name": "Button+ Integration", + "content_in_root": false, + "zip_release": false, + "render_readme": true, + "hide_default_branch": true, + "country": ["US", "UK"], + "homeassistant": "2023.8.0" +} From 7f5b868c0303ee9396a800a8c5437a573c67c836 Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:48:30 +0100 Subject: [PATCH 6/7] Fix CI config. --- .github/workflows/validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 812cfe1..4b041d1 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -20,4 +20,4 @@ jobs: steps: - uses: "actions/checkout@v3" - name: Hassfest validation - - uses: home-assistant/actions/hassfest@master + uses: home-assistant/actions/hassfest@master From 87cab4584aa0b6efacaacfb21f3edb35e877f909 Mon Sep 17 00:00:00 2001 From: Koen Hendriks Date: Tue, 2 Jan 2024 10:51:28 +0100 Subject: [PATCH 7/7] Sort manifest key correctly: domain, name, then alphabetical order --- custom_components/button_plus/manifest.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/custom_components/button_plus/manifest.json b/custom_components/button_plus/manifest.json index 7869e44..14c72b5 100644 --- a/custom_components/button_plus/manifest.json +++ b/custom_components/button_plus/manifest.json @@ -5,14 +5,15 @@ "@koenhendriks" ], "config_flow": true, - "dependencies": ["mqtt"], + "dependencies": [ + "mqtt" + ], "documentation": "https://github.com/koenhendriks/ha-button-plus", - "issue_tracker": "https://github.com/koenhendriks/ha-button-plus/issues", "homekit": {}, - "iot_class": "local_push", "integration_type": "hub", - "requirements": [ - ], + "iot_class": "local_push", + "issue_tracker": "https://github.com/koenhendriks/ha-button-plus/issues", + "requirements": [], "version": "0.0.1", "zeroconf": [] }