Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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:
- "*"
19 changes: 1 addition & 18 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,10 @@ categories:
- title: "🐛 Bug fixes"
labels:
- "bugfix"
# - title: "🚀 Enhancements"
# labels:
# - "enhancement"
# - "refactor"
# - "performance"
# - title: "🧰 Maintenance"
# labels:
# - "maintenance"
# - "ci"
# - title: "📚 Documentation"
# labels:
# - "documentation"
- title: "⬆️ Dependency updates"
collapse-after: 5
labels:
- "dependency-update"
# - title: "🚨🚨 Security Fixes 🚨🚨"
# labels:
# - "security"


include-labels:
Expand All @@ -46,6 +31,4 @@ template: |

$CHANGES

**Full Changelog**: https://github.com/ApolloAutomation/AIR-1_Test/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1

Be sure to 🌟 this repository for updates!
[Releases](https://github.com/ApolloAutomation/TEMP_PRO-1/releases)
2 changes: 1 addition & 1 deletion .github/workflows/autoassign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
yaml_changed: ${{ steps.check.outputs.yaml_changed }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2 # So we can diff the previous commit

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Read version from YAML file
id: read_version
Expand Down Expand Up @@ -89,6 +89,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


build-firmware-e:
name: Build And Release (Firmware)
uses: esphome/workflows/.github/workflows/build.yml@main
Expand Down Expand Up @@ -160,7 +161,7 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

# 1) Download Firmware
- uses: actions/download-artifact@v4
Expand Down
82 changes: 75 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,94 @@ name: CI

on:
pull_request:
schedule:
- cron: '0 0 * * 1'

permissions:
# Allow GITHUB_TOKEN to add labels to pull requests
pull-requests: write
issues: write
contents: read
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
label-check:
name: Label Check
runs-on: ubuntu-latest
outputs:
chosen_label: ${{ steps.determine_label.outputs.chosen_label }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Write PR Body to File
# We disable history expansion, then write the PR body directly.
run: |
set +H
set +o histexpand
printf '%s\n' "${{ github.event.pull_request.body }}" > pr_body.txt

- name: Determine Single Label
id: determine_label
run: |
label=""

# 1) Bugfix
if grep -qE '^- \[x\] Bugfix' pr_body.txt; then
label="bugfix"

# 2) New feature
elif grep -qE '^- \[x\] New feature' pr_body.txt; then
label="new-feature"

# 3) Breaking change
elif grep -qE '^- \[x\] Breaking change' pr_body.txt; then
label="breaking-change"

# 4) Dependency update
elif grep -qE '^- \[x\] Dependency Update - Does not publish' pr_body.txt; then
label="dependency-update"
fi

echo "Chosen label: $label"
echo "chosen_label=$label" >> $GITHUB_OUTPUT

- name: Apply Single Label
if: ${{ steps.determine_label.outputs.chosen_label != '' }}
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ steps.determine_label.outputs.chosen_label }}

ci:
name: Building ${{ matrix.file }}
name: ESPHome Build
needs: [ label-check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
- Integrations/ESPHome/TEMP_PRO-1_ETH.yaml
- Integrations/ESPHome/TEMP_PRO-1_W.yaml
- Integrations/ESPHome/TEMP_PRO-1_ETH.yaml
esphome-version:
- stable
- beta
- dev
steps:
- name: Checkout source code
uses: actions/[email protected]
- name: Build ESPHome firmware to verify configuration
- name: Checkout
uses: actions/checkout@v4

- name: Build ESPHome firmware
uses: esphome/build-action@v6
with:
yaml-file: ${{ matrix.file }}







44 changes: 44 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Weekly Firmware Build

on:
schedule:
- cron: '0 0 * * 1'

permissions:
contents: read
id-token: write

jobs:
ci:
name: Building ${{ matrix.file }}
runs-on: ubuntu-latest
strategy:
matrix:
file:
- Integrations/ESPHome/TEMP_PRO-1_ETH.yaml
- Integrations/ESPHome/TEMP_PRO-1_W.yaml
esphome-version:
- stable
- beta
- dev
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Build ESPHome firmware to verify configuration
uses: esphome/build-action@v6
with:
yaml-file: ${{ matrix.file }}

notify:
name: Notify on Failure
needs: [ ci ]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Send Discord notification
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ needs.ci.result }}
title: Build Failed - ESPHome Firmware
description: One or more ESPHome firmware builds failed. Check the logs for details.
83 changes: 65 additions & 18 deletions Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
substitutions:
version: "25.3.26.1"
device_description: ${name} made by Apollo Automation - version ${version}.
version: "25.3.31.1"
device_description: $TEMP_PRO-1 made by Apollo Automation - version ${version}.

esp32:
board: esp32-s3-devkitc-1
Expand Down Expand Up @@ -33,15 +33,6 @@ i2c:

web_server:
port: 80

ethernet:
type: W5500
clk_pin: GPIO10
mosi_pin: GPIO12
miso_pin: GPIO11
cs_pin: GPIO9
interrupt_pin: GPIO13
reset_pin: GPIO14

one_wire:
- platform: gpio
Expand Down Expand Up @@ -69,16 +60,33 @@ binary_sensor:
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) >= 10000) {
// Remove Wifi
id(factory_reset_switch).turn_on();
}
else {
// StatusCheck
id(statusCheck).execute();
}

- platform: template
name: Temperature Within Range
id: temp_within_range
lambda: 'return (id(sht_temperature).state < id(max_temp).state) && (id(sht_temperature).state > id(min_temp).state);'
update_interval: 10s
lambda: 'return (id(sht_temperature).state <= id(max_temp).state) && (id(sht_temperature).state >= id(min_temp).state) ? "true" : "false";'

- platform: template
name: Humidity Within Range
id: humidity_within_range
lambda: 'return (id(sht_humidity).state < id(max_humidity).state) && (id(sht_humidity).state > id(min_humidity).state);'
update_interval: 10s
lambda: 'return (id(sht_humidity).state <= id(max_humidity).state) && (id(sht_humidity).state >= id(min_humidity).state) ? "true" : "false";'

sensor:
- platform: internal_temperature
Expand Down Expand Up @@ -122,6 +130,16 @@ light:
max_brightness: 100%

button:
- platform: template
name: "Update Firmware"
id: update_firmware
entity_category: config
on_press:
then:
- lambda: |-
id(update_http_request).perform(true);


- platform: restart
icon: mdi:power-cycle
name: "ESP Reboot"
Expand All @@ -131,6 +149,8 @@ button:
name: "Factory Reset ESP"
id: factory_reset_all



number:
- platform: template
id: min_temp
Expand Down Expand Up @@ -196,13 +216,38 @@ switch:
id: alarm_outside_temp_range
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF

- platform: template
name: "Alarm Outside Humidity Range"
id: alarm_outside_humidity_range
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF

select:
- platform: template
id: firmware_selector
name: Firmware Type
icon: "mdi:test-tube"
entity_category: config
optimistic: true
restore_value: true
options:
- "WiFi"
- "Ethernet"
initial_option: "WiFi"
on_value:
then:
- if:
condition:
lambda: 'return id(firmware_selector).state == "Ethernet";'
then:
- logger.log: "OTA updates set to use ethernet firmware"
- lambda: id(update_http_request).set_source_url("https://apolloautomation.github.io/TEMP_PROJECT-1/firmware-e/manifest.json");
- component.update: update_http_request
else:
- logger.log: "OTA updates set to use wifi firmware"
- lambda: id(update_http_request).set_source_url("https://apolloautomation.github.io/TEMP_PROJECT-1/firmware-w/manifest.json");
- component.update: update_http_request

interval:
- interval: 10s
startup_delay: 10s
Expand All @@ -224,7 +269,9 @@ interval:
then:
- light.turn_off: rgb_light


## TODO: Add Update Frequency Control

## TODO: Specific Repo For Lot
text_sensor:
- platform: template
name: "OTA URL"
id: ota_url
entity_category: "diagnostic"
internal: true
Loading
Loading