Skip to content

Commit a42cd6d

Browse files
Merge pull request #65 from ApolloAutomation/beta
State Classes Strapping Pins
2 parents 3e209fc + c3ca903 commit a42cd6d

8 files changed

Lines changed: 173 additions & 79 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
From Core.yaml. Should match date YY.MM.DD.# ( Usually # is 1 )
3+
-->
4+
Version:
5+
6+
<!--
7+
You are amazing! Thanks for contributing to our project!
8+
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
9+
-->
10+
## What does this implement/fix?
11+
12+
13+
14+
## Types of changes
15+
<!--
16+
What type of change does your PR introduce?
17+
NOTE: Please, check only 1! box!
18+
If your PR requires multiple boxes to be checked, you'll most likely need to
19+
split it into multiple PRs. This makes things easier and faster to code review.
20+
-->
21+
22+
- [ ] Bugfix (fixed change that fixes an issue)
23+
- [ ] New feature (thanks!)
24+
- [ ] Breaking change (repair/feature that breaks existing functionality)
25+
- [ ] Dependency Update - Does not publish
26+
- [ ] Other - Does not publish
27+
- [ ] Website of github readme file update - Does not publish
28+
- [ ] Github workflows - Does not publish
29+
30+
31+
## Checklist / Checklijst:
32+
<!--
33+
Put an x in the boxes that apply. You can also fill these out after
34+
creating the PR. If you're unsure about any of them, don't hesitate to ask.
35+
We're here to help! This is simply a reminder of what we are going to look
36+
for before merging your code.
37+
-->
38+
39+
- [ ] The code change has been tested and works locally
40+
- [ ] The code change has not yet been tested
41+
42+
If user-visible functionality or configuration variables are added/modified:
43+
- [ ] Added/updated documentation for the web page
44+
45+
<!--
46+
Thank you for contributing <3
47+
-->

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
commit-message:
13+
prefix: "chore(ci): "
14+
groups:
15+
github-actions:
16+
patterns:
17+
- "*"

.github/release-drafter.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name-template: 'Release v$NEXT_PATCH_VERSION'
2+
tag-template: "$RESOLVED_VERSION"
3+
change-template: "- #$NUMBER $TITLE @$AUTHOR"
4+
sort-direction: ascending
5+
6+
categories:
7+
- title: "🚨 Breaking changes"
8+
labels:
9+
- "breaking-change"
10+
- title: "✨ New features"
11+
labels:
12+
- "new-feature"
13+
- title: "🐛 Bug fixes"
14+
labels:
15+
- "bugfix"
16+
- title: "⬆️ Dependency updates"
17+
collapse-after: 5
18+
labels:
19+
- "dependency-update"
20+
21+
22+
include-labels:
23+
- "bugfix"
24+
- "new-feature"
25+
- "breaking-change"
26+
27+
no-changes-template: '- No changes'
28+
29+
template: |
30+
## What's Changed
31+
32+
$CHANGES
33+
34+
**Full Changelog**: https://github.com/ApolloAutomation/AIR-1/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1
35+
36+
Be sure to 🌟 this repository for updates!

.github/workflows/autoassign.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
pull-requests: write
1313
steps:
1414
- name: 'Auto-assign issue'
15-
uses: pozil/auto-assign-issue@v1
15+
uses: pozil/auto-assign-issue@v2
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
assignees: TrevorSchirmer

.github/workflows/build.yml

Lines changed: 25 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,36 @@
1-
name: Publish
1+
name: Build and Publish
2+
23
on:
34
push:
45
branches:
56
- main
67
workflow_dispatch:
78
inputs:
8-
version:
9-
description: 'The version of the firmware to build'
10-
required: true
11-
release:
12-
types: [published]
9+
bypass-yaml-check:
10+
description: 'Bypass YAML change check (force build/publish)'
11+
type: boolean
12+
required: false
13+
default: false
14+
# release:
15+
# types: [published]
1316

1417
jobs:
15-
build-firmware:
16-
name: Build And Release
17-
uses: esphome/workflows/.github/workflows/build.yml@main
18-
with:
19-
files: |
20-
Integrations/ESPHome/AIR-1_Factory.yaml
21-
esphome-version: stable
22-
combined-name: firmware
23-
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
24-
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
25-
release-version: ${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}
26-
27-
build-site:
28-
name: Build Site
29-
runs-on: ubuntu-latest
30-
steps:
31-
- name: Checkout source code
32-
uses: actions/checkout@v4.1.7
33-
- name: Build
34-
uses: actions/jekyll-build-pages@v1.0.13
35-
with:
36-
source: ./static
37-
destination: ./output
38-
- name: Upload
39-
uses: actions/upload-artifact@v4.3.6
40-
with:
41-
name: site
42-
path: output
43-
44-
publish:
45-
name: Publish to GitHub Pages
46-
runs-on: ubuntu-latest
47-
needs:
48-
- build-firmware
49-
- build-site
18+
build-and-publish:
19+
uses: ApolloAutomation/Workflows/.github/workflows/build.yml@main
5020
permissions:
21+
contents: write
5122
pages: write
5223
id-token: write
53-
environment:
54-
name: github-pages
55-
url: ${{ steps.deployment.outputs.page_url }}
56-
steps:
57-
- uses: actions/download-artifact@v4.1.8
58-
with:
59-
name: firmware
60-
path: firmware
61-
62-
- name: Copy firmware and manifest
63-
run: |-
64-
mkdir -p output/firmware
65-
cp -r firmware/${{ needs.build-firmware.outputs.version }}/* output/firmware/
66-
67-
- uses: actions/download-artifact@v4.1.8
68-
with:
69-
name: site
70-
path: output
71-
72-
- uses: actions/upload-pages-artifact@v3.0.1
73-
with:
74-
path: output
75-
retention-days: 1
76-
77-
- name: Setup Pages
78-
uses: actions/configure-pages@v5.0.0
79-
80-
- name: Deploy to GitHub Pages
81-
id: deployment
82-
uses: actions/deploy-pages@v4.0.5
24+
pull-requests: write
25+
with:
26+
device-name: air-1
27+
yaml-files: |
28+
Integrations/ESPHome/AIR-1_Factory.yaml
29+
firmware-names: "_Factory:firmware"
30+
core-yaml-path: Integrations/ESPHome/Core.yaml
31+
esphome-version: stable
32+
# Bypass check if manually triggered with bypass option
33+
check-yaml-changes: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.bypass-yaml-check == 'true') }}
34+
publish-to-pages: true
35+
has-installer: true
36+
installer-path: static

.github/workflows/ci.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ name: CI
33
on:
44
pull_request:
55

6+
permissions:
7+
# Allow GITHUB_TOKEN to add labels to pull requests
8+
pull-requests: write
9+
issues: write
10+
contents: read
11+
id-token: write
12+
613
jobs:
14+
label-check:
15+
name: Label Check
16+
uses: ApolloAutomation/Workflows/.github/workflows/label-check.yml@main
17+
718
ci:
819
name: Building ${{ matrix.file }}
920
runs-on: ubuntu-latest
@@ -19,8 +30,8 @@ jobs:
1930
- dev
2031
steps:
2132
- name: Checkout source code
22-
uses: actions/checkout@v4.1.7
33+
uses: actions/checkout@v4.2.2
2334
- name: Build ESPHome firmware to verify configuration
24-
uses: esphome/build-action@v3.1.0
35+
uses: esphome/build-action@v7
2536
with:
26-
yaml_file: ${{ matrix.file }}
37+
yaml-file: ${{ matrix.file }}

.github/workflows/weekly.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Weekly Firmware Build
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1'
6+
7+
jobs:
8+
build:
9+
name: Building ${{ matrix.file }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
file:
14+
- Integrations/ESPHome/AIR-1.yaml
15+
- Integrations/ESPHome/AIR-1_BLE.yaml
16+
- Integrations/ESPHome/AIR-1_Factory.yaml
17+
esphome-version:
18+
- stable
19+
- beta
20+
- dev
21+
steps:
22+
- name: Checkout source code
23+
uses: actions/checkout@v4.2.2
24+
- name: Build ESPHome firmware to verify configuration
25+
uses: esphome/build-action@v7
26+
with:
27+
yaml-file: ${{ matrix.file }}

Integrations/ESPHome/Core.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
substitutions:
22
name: apollo-air-1
3-
version: "25.2.21.1"
3+
version: "25.6.24.1"
44
device_description: ${name} made by Apollo Automation - version ${version}.
55

66
esp32:
@@ -136,6 +136,7 @@ binary_sensor:
136136
mode:
137137
input: true
138138
pullup: true
139+
ignore_strapping_warning: true
139140
id: reset_button
140141
on_press:
141142
then:
@@ -278,7 +279,7 @@ sensor:
278279
name: "PM 1 To 2.5 µm"
279280
id: pm1_to_2_5
280281
disabled_by_default: true
281-
lambda: return id(pm_2_5).state - id(pm_1_0).state;
282+
lambda: return std::max(0.0f, id(pm_2_5).state - id(pm_1_0).state);
282283
unit_of_measurement: "µg/m³"
283284
state_class: measurement
284285
icon: mdi:air-filter
@@ -288,7 +289,7 @@ sensor:
288289
name: "PM 2.5 To 4 µm"
289290
id: pm2_5_to_4
290291
disabled_by_default: true
291-
lambda: return id(pm_4_0).state - id(pm_2_5).state;
292+
lambda: return std::max(0.0f, id(pm_4_0).state - id(pm_2_5).state);
292293
unit_of_measurement: "µg/m³"
293294
state_class: measurement
294295
icon: mdi:air-filter
@@ -298,8 +299,9 @@ sensor:
298299
name: "PM 4 To 10 µm"
299300
id: pm4_to_10
300301
disabled_by_default: true
301-
lambda: return id(pm_10_0).state - id(pm_4_0).state;
302+
lambda: return std::max(0.0f, id(pm_10_0).state - id(pm_4_0).state);
302303
unit_of_measurement: "µg/m³"
304+
state_class: measurement
303305
icon: mdi:air-filter
304306
update_interval: 10s
305307

0 commit comments

Comments
 (0)