mirror of
https://github.com/wled/WLED.git
synced 2025-07-29 13:46:39 +00:00
Merge pull request #4592 from netmindz/usermod-libs-matrix
Usermod libs matrix
This commit is contained in:
commit
7b0075d375
71
.github/workflows/usermods.yml
vendored
Normal file
71
.github/workflows/usermods.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: Usermod CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- usermods/**
|
||||||
|
- .github/workflows/usermods.yml
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
get_usermod_envs:
|
||||||
|
name: Gather Usermods
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
cache: 'pip'
|
||||||
|
- name: Install PlatformIO
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
- name: Get default environments
|
||||||
|
id: envs
|
||||||
|
run: |
|
||||||
|
echo "usermods=$(find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | jq -R | grep -v PWM_fan | grep -v BME68X_v2| grep -v pixels_dice_tray | jq --slurp -c)" >> $GITHUB_OUTPUT
|
||||||
|
outputs:
|
||||||
|
usermods: ${{ steps.envs.outputs.usermods }}
|
||||||
|
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build Enviornments
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: get_usermod_envs
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }}
|
||||||
|
environment: [usermods_esp32, usermods_esp32c3, usermods_esp32s2, usermods_esp32s3]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- name: Cache PlatformIO
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.platformio/.cache
|
||||||
|
~/.buildcache
|
||||||
|
build_output
|
||||||
|
key: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}-${{ hashFiles('wled00/**', 'usermods/**') }}
|
||||||
|
restore-keys: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}-
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
cache: 'pip'
|
||||||
|
- name: Install PlatformIO
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
- name: Add usermods environment
|
||||||
|
run: |
|
||||||
|
cp -v usermods/platformio_override.usermods.ini platformio_override.ini
|
||||||
|
echo >> platformio_override.ini
|
||||||
|
echo "custom_usermods = ${{ matrix.usermod }}" >> platformio_override.ini
|
||||||
|
cat platformio_override.ini
|
||||||
|
|
||||||
|
- name: Build firmware
|
||||||
|
run: pio run -e ${{ matrix.environment }}
|
@ -3,6 +3,8 @@
|
|||||||
"build": { "libArchive": false },
|
"build": { "libArchive": false },
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"finitespace/BME280":"3.0.0",
|
"finitespace/BME280":"3.0.0",
|
||||||
"adafruit/Adafruit Si7021 Library" : "1.5.3"
|
"adafruit/Adafruit Si7021 Library" : "1.5.3",
|
||||||
|
"SPI":"*",
|
||||||
|
"adafruit/Adafruit BusIO": "1.17.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -49,18 +49,8 @@ SDA_PIN = 4;
|
|||||||
|
|
||||||
## Software
|
## Software
|
||||||
|
|
||||||
Add to `build_flags` in platformio.ini:
|
Add `Si7021_MQTT_HA` to custom_usermods
|
||||||
|
|
||||||
```
|
|
||||||
-D USERMOD_SI7021_MQTT_HA
|
|
||||||
```
|
|
||||||
|
|
||||||
Add to `lib_deps` in platformio.ini:
|
|
||||||
|
|
||||||
```
|
|
||||||
adafruit/Adafruit Si7021 Library @ 1.4.0
|
|
||||||
BME280@~3.0.0
|
|
||||||
```
|
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
|
|
||||||
|
@ -5,16 +5,17 @@
|
|||||||
|
|
||||||
#define USERMOD_ID_BUZZER 900
|
#define USERMOD_ID_BUZZER 900
|
||||||
#ifndef USERMOD_BUZZER_PIN
|
#ifndef USERMOD_BUZZER_PIN
|
||||||
|
#ifdef GPIO_NUM_32
|
||||||
#define USERMOD_BUZZER_PIN GPIO_NUM_32
|
#define USERMOD_BUZZER_PIN GPIO_NUM_32
|
||||||
|
#else
|
||||||
|
#define USERMOD_BUZZER_PIN 21
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Usermods allow you to add own functionality to WLED more easily
|
* Usermods allow you to add own functionality to WLED more easily
|
||||||
* See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
|
* See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
|
||||||
*
|
*
|
||||||
* Using a usermod:
|
|
||||||
* 1. Copy the usermod into the sketch folder (same folder as wled00.ino)
|
|
||||||
* 2. Register the usermod by adding #include "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BuzzerUsermod : public Usermod {
|
class BuzzerUsermod : public Usermod {
|
||||||
|
31
usermods/platformio_override.usermods.ini
Normal file
31
usermods/platformio_override.usermods.ini
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
[platformio]
|
||||||
|
default_envs = usermods_esp32, usermods_esp32c3, usermods_esp32s2, usermods_esp32s3
|
||||||
|
|
||||||
|
[env:usermods_esp32]
|
||||||
|
extends = env:esp32dev_V4
|
||||||
|
custom_usermods = ${usermods.custom_usermods}
|
||||||
|
board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat
|
||||||
|
|
||||||
|
|
||||||
|
[env:usermods_esp32c3]
|
||||||
|
extends = env:esp32c3dev
|
||||||
|
board = esp32-c3-devkitm-1
|
||||||
|
custom_usermods = ${usermods.custom_usermods}
|
||||||
|
board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat
|
||||||
|
|
||||||
|
|
||||||
|
[env:usermods_esp32s2]
|
||||||
|
extends = env:lolin_s2_mini
|
||||||
|
custom_usermods = ${usermods.custom_usermods}
|
||||||
|
board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat
|
||||||
|
|
||||||
|
|
||||||
|
[env:usermods_esp32s3]
|
||||||
|
extends = env:esp32s3dev_16MB_opi
|
||||||
|
custom_usermods = ${usermods.custom_usermods}
|
||||||
|
board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[usermods]
|
||||||
|
# Added in CI
|
Loading…
x
Reference in New Issue
Block a user