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 bbff013..f87cc61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,82 +1,36 @@ -name: Publish +name: Build and Publish + on: push: branches: - main workflow_dispatch: inputs: - version: - description: 'The version of the firmware to build' - required: true - release: - types: [published] + bypass-yaml-check: + description: 'Bypass YAML change check (force build/publish)' + type: boolean + required: false + default: false + # release: + # types: [published] jobs: - build-firmware: - name: Build And Release - uses: esphome/workflows/.github/workflows/build.yml@main - with: - files: | - Integrations/ESPHome/MSR-2_Factory.yaml - esphome-version: stable - combined-name: firmware - release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }} - release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }} - release-version: ${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }} - - build-site: - name: Build Site - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v4.1.7 - - name: Build - uses: actions/jekyll-build-pages@v1.0.13 - with: - source: ./static - destination: ./output - - name: Upload - uses: actions/upload-artifact@v4.3.6 - with: - name: site - path: output - - publish: - name: Publish to GitHub Pages - runs-on: ubuntu-latest - needs: - - build-firmware - - build-site + 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: - - uses: actions/download-artifact@v4.1.8 - with: - name: firmware - path: firmware - - - name: Copy firmware and manifest - run: |- - mkdir -p output/firmware - cp -r firmware/${{ needs.build-firmware.outputs.version }}/* output/firmware/ - - - uses: actions/download-artifact@v4.1.8 - with: - name: site - path: output - - - uses: actions/upload-pages-artifact@v3.0.1 - with: - path: output - retention-days: 1 - - - name: Setup Pages - uses: actions/configure-pages@v5.0.0 - - - 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 b51a836..662e387 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,24 +3,35 @@ 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 strategy: matrix: file: + - Integrations/ESPHome/MSR-2_Factory.yaml - Integrations/ESPHome/MSR-2.yaml - Integrations/ESPHome/MSR-2_BLE.yaml - - Integrations/ESPHome/MSR-2_Factory.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/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index a7a87a9..13ca0e1 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.7.29.1" device_description: ${name} made by Apollo Automation - version ${version}. esp32: @@ -12,6 +12,7 @@ captive_portal: web_server: port: 80 + version: 3 globals: - id: button_press_timestamp @@ -294,7 +295,7 @@ binary_sensor: return false; } - platform: gpio - pin: + pin: number: GPIO9 inverted: true ignore_strapping_warning: true @@ -306,19 +307,18 @@ binary_sensor: then: - lambda: |- id(button_press_timestamp) = millis(); - + on_release: then: - lambda: |- - if (millis() - id(button_press_timestamp) >= 1000) { + 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(); } - else if (millis() - id(button_press_timestamp) >= 8000) { - id(factory_reset_switch).turn_on(); - - } ld2410: id: ld2410_radar @@ -797,4 +797,4 @@ script: green: 0% blue: 0% - light.turn_off: - id: rgb_light \ No newline at end of file + id: rgb_light diff --git a/Integrations/ESPHome/MSR-2_BLE.yaml b/Integrations/ESPHome/MSR-2_BLE.yaml index 4e7410b..6a8408c 100644 --- a/Integrations/ESPHome/MSR-2_BLE.yaml +++ b/Integrations/ESPHome/MSR-2_BLE.yaml @@ -25,6 +25,7 @@ esphome: min_version: 2025.2.0 +logger: dashboard_import: package_import_url: github://ApolloAutomation/MSR-2/Integrations/ESPHome/MSR-2_BLE.yaml @@ -40,6 +41,9 @@ ota: bluetooth_proxy: active: true +esp32_ble_tracker: + scan_parameters: + active: false packages: core: !include Core.yaml diff --git a/static/index.html b/static/index.html index 2d67ae4..1c803db 100644 --- a/static/index.html +++ b/static/index.html @@ -81,12 +81,9 @@

Apollo MSR-2 Installer

-
-
-

MSR-2 Firmware

- -
-
+

+ +