From 84a7b4fb89e3afac95615579dd9b6f211904a527 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Fri, 9 May 2025 11:30:57 -0500 Subject: [PATCH 01/11] Update MSR-2_BLE.yaml to use correct ble proxy Update MSR-2_BLE.yaml to use correct ble proxy needed all 5 lines not 2. --- Integrations/ESPHome/MSR-2_BLE.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Integrations/ESPHome/MSR-2_BLE.yaml b/Integrations/ESPHome/MSR-2_BLE.yaml index 4e7410b..8f13733 100644 --- a/Integrations/ESPHome/MSR-2_BLE.yaml +++ b/Integrations/ESPHome/MSR-2_BLE.yaml @@ -40,6 +40,9 @@ ota: bluetooth_proxy: active: true +esp32_ble_tracker: + scan_parameters: + active: false packages: core: !include Core.yaml From 4d4bcbb378078ab29b49ec2c09cf093e3101ae76 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Fri, 9 May 2025 11:49:12 -0500 Subject: [PATCH 02/11] Update Core.yaml --- Integrations/ESPHome/Core.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index a7a87a9..383b2a4 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -1,6 +1,6 @@ substitutions: name: apollo-msr-2 - version: "25.2.21.2" + version: "25.5.9.1" device_description: ${name} made by Apollo Automation - version ${version}. esp32: @@ -797,4 +797,4 @@ script: green: 0% blue: 0% - light.turn_off: - id: rgb_light \ No newline at end of file + id: rgb_light From 30d23497efd3e71d807f62a65beb1f68c11823c8 Mon Sep 17 00:00:00 2001 From: Justin Bunton <130115204+Bunton33@users.noreply.github.com> Date: Wed, 14 May 2025 18:39:31 -0400 Subject: [PATCH 03/11] Reset Wi-Fi Credentials Fix boot button press for resetting Wi-Fi credentials --- Integrations/ESPHome/Core.yaml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index a7a87a9..55fb5bc 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -232,8 +232,6 @@ output: rtttl: output: buzzer - - binary_sensor: - platform: status name: Online @@ -248,6 +246,32 @@ binary_sensor: has_still_target: name: Radar Still Target id: radar_has_still_target + + - platform: gpio + pin: + number: GPIO0 + inverted: true + ignore_strapping_warning: true + mode: + input: true + pullup: true + id: reset_button + on_press: + then: + - lambda: |- + id(button_press_timestamp) = millis(); + + on_release: + then: + - lambda: |- + if (millis() - id(button_press_timestamp) >= 8000) { + id(factory_reset_switch).turn_on(); + } + else if (millis() - id(button_press_timestamp) >= 1000) { + //id(testCycleCount) = 0; + //id(runTest) = true; + //id(testScript).execute(); + } ## Set Up Radar Zones Based On Distance From 1a552dcebf76040ec1df89150115d2af34d5784a Mon Sep 17 00:00:00 2001 From: Justin Bunton <130115204+Bunton33@users.noreply.github.com> Date: Wed, 14 May 2025 18:40:50 -0400 Subject: [PATCH 04/11] Reset Wi-Fi Credentials Fixed code to allow boot button to reset Wi-Fi credentials. --- Integrations/ESPHome/Core.yaml | 35 +++++----------------------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 55fb5bc..f1780d3 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -232,6 +232,8 @@ output: rtttl: output: buzzer + + binary_sensor: - platform: status name: Online @@ -246,32 +248,6 @@ binary_sensor: has_still_target: name: Radar Still Target id: radar_has_still_target - - - platform: gpio - pin: - number: GPIO0 - inverted: true - ignore_strapping_warning: true - mode: - input: true - pullup: true - id: reset_button - on_press: - then: - - lambda: |- - id(button_press_timestamp) = millis(); - - on_release: - then: - - lambda: |- - if (millis() - id(button_press_timestamp) >= 8000) { - id(factory_reset_switch).turn_on(); - } - else if (millis() - id(button_press_timestamp) >= 1000) { - //id(testCycleCount) = 0; - //id(runTest) = true; - //id(testScript).execute(); - } ## Set Up Radar Zones Based On Distance @@ -334,15 +310,14 @@ binary_sensor: on_release: then: - lambda: |- + else if (millis() - id(button_press_timestamp) >= 8000) { + id(factory_reset_switch).turn_on(); + } if (millis() - id(button_press_timestamp) >= 1000) { id(testCycleCount) = 0; id(runTest) = true; id(testScript).execute(); } - else if (millis() - id(button_press_timestamp) >= 8000) { - id(factory_reset_switch).turn_on(); - - } ld2410: id: ld2410_radar From 99e03403c26076d3166191af1b81d55b312c0a96 Mon Sep 17 00:00:00 2001 From: Justin Bunton <130115204+Bunton33@users.noreply.github.com> Date: Thu, 15 May 2025 09:20:26 -0400 Subject: [PATCH 05/11] Fix Reset Wi-Fi Fixed the reset Wi-Fi credentials function --- Integrations/ESPHome/Core.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index f1780d3..7046311 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -294,7 +294,7 @@ binary_sensor: return false; } - platform: gpio - pin: + pin: number: GPIO9 inverted: true ignore_strapping_warning: true @@ -306,14 +306,14 @@ binary_sensor: then: - lambda: |- id(button_press_timestamp) = millis(); - + on_release: then: - lambda: |- - else if (millis() - id(button_press_timestamp) >= 8000) { + if (millis() - id(button_press_timestamp) >= 8000) { id(factory_reset_switch).turn_on(); } - if (millis() - id(button_press_timestamp) >= 1000) { + else if (millis() - id(button_press_timestamp) >= 1000) { id(testCycleCount) = 0; id(runTest) = true; id(testScript).execute(); From 21309a44b8f83594968f6a1c13973ba2ab482c9b Mon Sep 17 00:00:00 2001 From: Justin Bunton <130115204+Bunton33@users.noreply.github.com> Date: Thu, 15 May 2025 12:01:15 -0400 Subject: [PATCH 06/11] Update Version Number Updated version number --- Integrations/ESPHome/Core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 7046311..7936714 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -1,6 +1,6 @@ substitutions: name: apollo-msr-2 - version: "25.2.21.2" + version: "25.5.15.1" device_description: ${name} made by Apollo Automation - version ${version}. esp32: From d1c32394f9940379644de32452d6d5c78040b751 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Tue, 3 Jun 2025 07:55:14 -0500 Subject: [PATCH 07/11] update to using web_server version 3 for a much nicer GUI for the web_server component web_server: version: 3 changes to use the new much prettier web_server version 3 --- Integrations/ESPHome/Core.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 2c1d81e..d785da7 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -12,6 +12,7 @@ captive_portal: web_server: port: 80 + version: 3 globals: - id: button_press_timestamp @@ -797,4 +798,4 @@ script: green: 0% blue: 0% - light.turn_off: - id: rgb_light \ No newline at end of file + id: rgb_light From b91e3d5af35b71cd667375e3dfc1ec568e47ea4e Mon Sep 17 00:00:00 2001 From: Trevor Schirmer Date: Mon, 23 Jun 2025 23:58:46 -0400 Subject: [PATCH 08/11] Update Pipeline --- .github/PULL_REQUEST_TEMPLATE.md | 47 +++++++++ .github/dependabot.yml | 17 ++++ .github/release-drafter.yml | 35 +++++++ .github/workflows/autoassign.yml | 2 +- .github/workflows/build.yml | 158 +++++-------------------------- .github/workflows/ci.yml | 21 +++- .github/workflows/weekly.yml | 27 ++++++ static/index.html | 3 +- 8 files changed, 172 insertions(+), 138 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/weekly.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..a298f9f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,47 @@ + +Version: + + +## What does this implement/fix? + + + +## Types of changes + + +- [ ] Bugfix (fixed change that fixes an issue) +- [ ] New feature (thanks!) +- [ ] Breaking change (repair/feature that breaks existing functionality) +- [ ] Dependency Update - Does not publish +- [ ] Other - Does not publish +- [ ] Website of github readme file update - Does not publish +- [ ] Github workflows - Does not publish + + +## Checklist / Checklijst: + + + - [ ] The code change has been tested and works locally + - [ ] The code change has not yet been tested + +If user-visible functionality or configuration variables are added/modified: + - [ ] Added/updated documentation for the web page + + \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a689b1e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +# To get started with Dependabot version updates, you'll need to specify which + # package ecosystems to update and where the package manifests are located. + # Please see the documentation for all configuration options: + # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + + version: 2 + updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(ci): " + groups: + github-actions: + patterns: + - "*" \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..5fb32e3 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,35 @@ +name-template: 'Release v$NEXT_PATCH_VERSION' +tag-template: "$RESOLVED_VERSION" +change-template: "- #$NUMBER $TITLE @$AUTHOR" +sort-direction: ascending + +categories: + - title: "🚨 Breaking changes" + labels: + - "breaking-change" + - title: "✨ New features" + labels: + - "new-feature" + - title: "🐛 Bug fixes" + labels: + - "bugfix" + - title: "⬆️ Dependency updates" + collapse-after: 5 + labels: + - "dependency-update" + +include-labels: + - "bugfix" + - "new-feature" + - "breaking-change" + +no-changes-template: '- No changes' + +template: | + ## What's Changed + + $CHANGES + + **Full Changelog**: https://github.com/ApolloAutomation/MSR-2/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1 + + Be sure to 🌟 this repository for updates! \ No newline at end of file diff --git a/.github/workflows/autoassign.yml b/.github/workflows/autoassign.yml index 0158e68..d5a6557 100644 --- a/.github/workflows/autoassign.yml +++ b/.github/workflows/autoassign.yml @@ -12,7 +12,7 @@ jobs: pull-requests: write steps: - name: 'Auto-assign issue' - uses: pozil/auto-assign-issue@v1 + uses: pozil/auto-assign-issue@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} assignees: TrevorSchirmer diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6fe9d49..f87cc61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,142 +1,36 @@ -name: Build -env: - DEVICE_NAME: msr-2 - RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/latest +name: Build and Publish on: push: branches: - main + workflow_dispatch: + inputs: + bypass-yaml-check: + description: 'Bypass YAML change check (force build/publish)' + type: boolean + required: false + default: false + # release: + # types: [published] jobs: - build: - name: Build And Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set uppercase DEVICE_NAME - run: | - echo "UPPERCASE_DEVICE_NAME=$(echo $DEVICE_NAME | tr '[:lower:]' '[:upper:]')" >> $GITHUB_ENV - - - name: Build Firmware - uses: esphome/build-action@v3.0.0 - id: esphome-build - with: - yaml_file: Integrations/ESPHome/${{ env.UPPERCASE_DEVICE_NAME }}.yaml - version: 'latest' - cache: true - - - name: Read version from YAML file - id: read_version - run: | - version=$(awk '/substitutions:/ {found=1} found && /version:/ {print $2; exit}' Integrations/ESPHome/${{ env.UPPERCASE_DEVICE_NAME }}.yaml | tr -d '"') - echo "project_version=$version" >> $GITHUB_ENV - - - name: Move generated files to output - run: | - mkdir -p output - mv ${{ steps.esphome-build.outputs.name }}/* output/ - echo ${{ steps.esphome-build.outputs.version }} > output/version - # Extract MD5 checksum of firmware.ota.bin - MD5_CHECKSUM=$(jq -r '.ota.md5' output/manifest.json) - echo "MD5_CHECKSUM=$MD5_CHECKSUM" >> $GITHUB_ENV - - # Create new manifest.json with jq - jq -n --arg name "${{ env.DEVICE_NAME }}" \ - --arg version "${{ env.project_version }}" \ - --arg md5 "$MD5_CHECKSUM" \ - '{name: $name, version: $version, home_assistant_domain: "esphome", new_install_prompt_erase: false, builds: [{chipFamily: "ESP32-C3", parts: [{path: "apollo-${{ env.DEVICE_NAME }}-esp32c3.factory.bin", offset: 0}], ota: {path: "apollo-${{ env.DEVICE_NAME }}-esp32c3.ota.bin", md5: $md5}}]}' > output/manifest.json - - - - uses: actions/upload-artifact@v4.3.3 - with: - path: output/ - retention-days: 1 - - - name: Collect merge commits - id: collect_commits - run: | - MERGE_COMMITS=$(git log --merges --pretty=format:"%h %s" $(git describe --tags --abbrev=0 @^)..@) - echo "MERGE_COMMITS=$MERGE_COMMITS" >> $GITHUB_ENV - - - name: Create Release - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - with: - tag_name: ${{ env.project_version }} - release_name: "Release ${{ env.project_version }}" - body: Release of version ${{ env.project_version }} - - draft: false - prerelease: false - - - name: Upload firmware.factory.bin to Release - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: output/apollo-${{ env.DEVICE_NAME }}-esp32c3.factory.bin - asset_name: apollo-${{ env.DEVICE_NAME }}-esp32c3.factory.bin - asset_content_type: application/octet-stream - - - name: Upload firmware.ota.bin to Release - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: output/apollo-${{ env.DEVICE_NAME }}-esp32c3.ota.bin - asset_name: apollo-${{ env.DEVICE_NAME }}-esp32c3.ota.bin - asset_content_type: application/octet-stream - - name: Upload firmware.ota.bin to Release - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: output/manifest.json - asset_name: manifest.json - asset_content_type: application/octet-stream - - - prep: - name: Consolidate firmwares - runs-on: ubuntu-latest - needs: - - build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4.1.7 - with: - path: output - - run: cp -R static/* output/ - - uses: actions/upload-pages-artifact@v3.0.1 - with: - path: output - retention-days: 1 - - deploy: - if: contains(fromJSON('["workflow_dispatch", "push", "schedule"]'), github.event_name) && github.ref == 'refs/heads/main' - name: Deploy to GitHub Pages - runs-on: ubuntu-latest - needs: prep + build-and-publish: + uses: ApolloAutomation/Workflows/.github/workflows/build.yml@main permissions: + contents: write pages: write id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4.0.5 + pull-requests: write + with: + device-name: msr-2 + yaml-files: | + Integrations/ESPHome/MSR-2_Factory.yaml + firmware-names: "_Factory:firmware" + core-yaml-path: Integrations/ESPHome/Core.yaml + esphome-version: stable + # Bypass check if manually triggered with bypass option + check-yaml-changes: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.bypass-yaml-check == 'true') }} + publish-to-pages: true + has-installer: true + installer-path: static diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92b1f7c..662e387 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,18 @@ name: CI on: pull_request: +permissions: + # Allow GITHUB_TOKEN to add labels to pull requests + pull-requests: write + issues: write + contents: read + id-token: write + jobs: + label-check: + name: Label Check + uses: ApolloAutomation/Workflows/.github/workflows/label-check.yml@main + ci: name: Building ${{ matrix.file }} runs-on: ubuntu-latest @@ -13,10 +24,14 @@ jobs: - Integrations/ESPHome/MSR-2_Factory.yaml - Integrations/ESPHome/MSR-2.yaml - Integrations/ESPHome/MSR-2_BLE.yaml + esphome-version: + - stable + - beta + - dev steps: - name: Checkout source code - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Build ESPHome firmware to verify configuration - uses: esphome/build-action@v3.1.0 + uses: esphome/build-action@v7 with: - yaml_file: ${{ matrix.file }} \ No newline at end of file + yaml-file: ${{ matrix.file }} \ No newline at end of file diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 0000000..1e2cc27 --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,27 @@ +name: Weekly Firmware Build + +on: + schedule: + - cron: '0 0 * * 1' + +jobs: + build: + name: Building ${{ matrix.file }} + runs-on: ubuntu-latest + strategy: + matrix: + file: + - Integrations/ESPHome/MSR-2_Factory.yaml + - Integrations/ESPHome/MSR-2.yaml + - Integrations/ESPHome/MSR-2_BLE.yaml + esphome-version: + - stable + - beta + - dev + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + - name: Build ESPHome firmware to verify configuration + uses: esphome/build-action@v7 + with: + yaml-file: ${{ matrix.file }} \ No newline at end of file diff --git a/static/index.html b/static/index.html index fb318a4..1c803db 100644 --- a/static/index.html +++ b/static/index.html @@ -82,8 +82,7 @@

Apollo MSR-2 Installer

- - +