Skip to content

Commit a37c461

Browse files
authored
Add CI and release workflows, and GitHub pages, as per official template (#13)
* Add initial config file for pump controller * Add CICD and GitHub Pages config as per official project template * Run CI on push to or pull request to master * Remove unneeded file copied from template * Fix ID conflict * Add missing factory config
1 parent 4047e85 commit a37c461

File tree

8 files changed

+243
-0
lines changed

8 files changed

+243
-0
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
ci:
17+
name: Building ${{ matrix.file }} / ${{ matrix.esphome-version }}
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
max-parallel: 3
22+
matrix:
23+
#### Modify below here to match your project ####
24+
file:
25+
- intex-pool-pump-controller
26+
#### Modify above here to match your project ####
27+
28+
esphome-version:
29+
- stable
30+
- beta
31+
- dev
32+
steps:
33+
- name: Checkout source code
34+
uses: actions/[email protected]
35+
- name: ESPHome ${{ matrix.esphome-version }}
36+
uses: esphome/[email protected]
37+
with:
38+
yaml-file: ${{ matrix.file }}.yaml
39+
version: ${{ matrix.esphome-version }}
40+
- name: ESPHome ${{ matrix.esphome-version }} Factory
41+
uses: esphome/[email protected]
42+
with:
43+
yaml-file: ${{ matrix.file }}.factory.yaml
44+
version: ${{ matrix.esphome-version }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Firmware
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-firmware:
12+
name: Build Firmware
13+
uses: esphome/workflows/.github/workflows/[email protected]
14+
with:
15+
#### Modify below here to match your project ####
16+
files: |
17+
intex-pool-pump-controller.yaml
18+
esphome-version: 2025.4.0
19+
#### Modify above here to match your project ####
20+
21+
release-summary: ${{ github.event.release.body }}
22+
release-url: ${{ github.event.release.html_url }}
23+
release-version: ${{ github.event.release.tag_name }}
24+
25+
upload-to-release:
26+
name: Upload to Release
27+
uses: esphome/workflows/.github/workflows/[email protected]
28+
needs:
29+
- build-firmware
30+
with:
31+
version: ${{ github.event.release.tag_name }}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'static/**'
9+
- '.github/workflows/publish-pages.yml'
10+
workflow_run:
11+
workflows:
12+
- Publish Firmware
13+
types:
14+
- completed
15+
pull_request:
16+
paths:
17+
- 'static/**'
18+
- '.github/workflows/publish-pages.yml'
19+
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
build:
27+
name: Build
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout source code
31+
uses: actions/[email protected]
32+
33+
- run: mkdir -p output/firmware
34+
35+
- name: Build
36+
uses: actions/[email protected]
37+
with:
38+
source: ./static
39+
destination: ./output
40+
41+
- name: Fetch firmware files
42+
uses: robinraju/[email protected]
43+
with:
44+
latest: true
45+
fileName: '*'
46+
out-file-path: output/firmware
47+
48+
- name: Upload artifact
49+
uses: actions/[email protected]
50+
with:
51+
path: output
52+
retention-days: 1
53+
54+
publish:
55+
if: github.event_name != 'pull_request'
56+
name: Publish
57+
runs-on: ubuntu-latest
58+
needs:
59+
- build
60+
permissions:
61+
pages: write
62+
id-token: write
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
steps:
67+
- name: Setup Pages
68+
uses: actions/[email protected]
69+
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/[email protected]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
packages:
2+
# Include all of the core configuration
3+
core: !include intex-pool-pump-controller.yaml
4+
5+
esphome:
6+
# This will allow for project identification,
7+
# configuration and updates.
8+
project:
9+
name: esphome.project-template
10+
version: dev # This will be replaced by the github workflows with the `release` version
11+
12+
# This should point to the public location of the yaml file that will be adopted.
13+
# In this case it is the core yaml file that does not contain the extra things
14+
# that are provided by this factory yaml file as the user does not need these once adopted.
15+
dashboard_import:
16+
package_import_url: github://danielschenk/esphome-components/intex-pool-pump-controller.yaml@master
17+
18+
# Sets up Bluetooth LE (Only on ESP32) to allow the user
19+
# to provision wifi credentials to the device.
20+
esp32_improv:
21+
authorizer: none
22+
23+
# Sets up the improv via serial client for Wi-Fi provisioning.
24+
# Handy if your device has a usb port for the user to add credentials when they first get it.
25+
improv_serial:

intex-pool-pump-controller.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
esphome:
2+
name: pool-pump
3+
friendly_name: Pool pump controller
4+
# Automatically add the mac address to the name
5+
# so you can use a single firmware for all devices
6+
name_add_mac_suffix: true
7+
8+
esp32:
9+
board: nodemcu-32s
10+
11+
# To be able to get logs from the device via serial and api.
12+
logger:
13+
14+
# API is a requirement of the dashboard import.
15+
api:
16+
17+
# OTA is required for Over-the-Air updating
18+
ota:
19+
- platform: esphome
20+
21+
wifi:
22+
# Set up a wifi access point using the device name above
23+
ap:
24+
25+
# In combination with the `ap` this allows the user
26+
# to provision wifi credentials to the device.
27+
captive_portal:
28+
29+
intex_sf90220rc1:
30+
id: pool_pump
31+
32+
switch:
33+
- platform: intex_sf90220rc1
34+
pump_id: pool_pump
35+
power_switch:
36+
id: pool_pump_power
37+
name: Pool pump
38+
icon: mdi:pump
39+
40+
uart:
41+
tx_pin: GPIO32
42+
rx_pin: GPIO33
43+
baud_rate: 2400
44+
45+
external_components:
46+
- source: components

static/_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title: Intex pool filtration controller for ESPHome
2+
description: |
3+
This is custom firmware based on ESPHome, which allows you to control certain Intex pool
4+
filtration pumps and saltwater chlorinators with an ESP32 microcontroller.
5+
theme: jekyll-theme-slate

static/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# About
2+
3+
This is custom firmware based on ESPHome, which allows you to remote control certain Intex
4+
pool filtration pumps and saltwater chlorinators with an ESP32 microcontroller. You can
5+
remotely power toggle the devices by any means supported by ESPHome, most notably the
6+
Home Assistant home automation platform.
7+
8+
# Installation
9+
10+
You can use the buttons below to install the pre-built firmware directly to your device via USB from the browser.
11+
12+
Pump: <esp-web-install-button manifest="firmware/pool-pump.manifest.json"></esp-web-install-button>
13+
14+
<script type="module" src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"></script>

0 commit comments

Comments
 (0)