From 25960df598c2efa612a38c65ec6c25315fc7fe0e Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 15 Feb 2021 07:57:44 +1300 Subject: [PATCH 1/4] Update add-on configuration for Supervisor 2021.2 --- template/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/config.yaml b/template/config.yaml index e846882..d3f52e3 100644 --- a/template/config.yaml +++ b/template/config.yaml @@ -21,7 +21,7 @@ base: &base ingress_port: 0 panel_icon: 'mdi:chip' # Automatically add UART devices to addon - auto_uart: true + uart: true ports: '6052/tcp': null ports_description: From 34dc4953945e1e9e6d096021d9905c4c67ff6191 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 15 Feb 2021 08:11:32 +1300 Subject: [PATCH 2/4] Update settings from #17 --- template/config.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/template/config.yaml b/template/config.yaml index d3f52e3..91e5bef 100644 --- a/template/config.yaml +++ b/template/config.yaml @@ -1,9 +1,6 @@ --- base: &base url: https://esphome.io/ - webui: 'http://[HOST]:[PORT:6052]' - startup: application - boot: auto arch: - amd64 - armv7 @@ -11,9 +8,6 @@ base: &base # Uses Hass.io API (auth) hassio_api: true auth_api: true - hassio_role: default - # Doesn't use HA API - homeassistant_api: false # Host network mode for mDNS host_network: true # Ingress settings @@ -62,7 +56,6 @@ esphome-beta: url: https://beta.esphome.io/ image: esphome/esphome-hassio-{arch} stage: experimental - options: {} esphome-stable: <<: *base @@ -72,8 +65,6 @@ esphome-stable: slug: esphome description: "ESPHome Hass.io add-on for intelligently managing all your ESP8266/ESP32 devices." image: esphome/esphome-hassio-{arch} - stage: stable - options: {} copy_files: icon.png: From 6b9694fad176f2ff11c54ff0ee03a01fe4605fd4 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 15 Feb 2021 08:28:48 +1300 Subject: [PATCH 3/4] Lint the generated files --- .github/workflows/lint.yml | 8 ++++++++ script/generate.py | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 499e55c..26632a3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,6 +10,14 @@ jobs: steps: - name: โคต๏ธ Check out code from GitHub uses: actions/checkout@v2 + - name: ๐Ÿ›  Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: ๐Ÿ›  Install dependencies + run: pip install -r script/requirements.txt + - name: ๐Ÿ›  Generate files from template + run: python script/generate.py dev beta stable - name: ๐Ÿš€ Run Home Assistant Add-on Lint on ${{ matrix.channel }} uses: frenck/action-addon-linter@v2 with: diff --git a/script/generate.py b/script/generate.py index fd4400e..b382dbd 100755 --- a/script/generate.py +++ b/script/generate.py @@ -41,9 +41,7 @@ def main(args): if channel == Channel.dev: path = dir_ / 'build.json' build_conf = { - 'squash': False, - "build_from": {arch: base_image.format(arch=arch) for arch in conf['arch']}, - "args": {} + "build_from": {arch: base_image.format(arch=arch) for arch in conf['arch']} } with open(path, 'w') as f: json.dump(build_conf, f, indent=2, sort_keys=True) From 4e170493c7c1a1b27376531f9b7bbcf498f84753 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 15 Feb 2021 08:45:10 +1300 Subject: [PATCH 4/4] Add warning file to generated folders --- script/generate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/generate.py b/script/generate.py index b382dbd..e03b762 100755 --- a/script/generate.py +++ b/script/generate.py @@ -38,6 +38,10 @@ def main(args): for file_, conf_ in copyf.items(): copyfile(templ / file_, dir_ / file_) + path = dir_ / 'FILES ARE GENERATED DO NOT EDIT' + with open(path, 'w') as f: + f.write("Any edits should be made to the files in the 'template' directory") + if channel == Channel.dev: path = dir_ / 'build.json' build_conf = {