Skip to content

Commit

Permalink
Merge wled/master into sr-wled/master
Browse files Browse the repository at this point in the history
Initially had merge issues, working on a fix
  • Loading branch information
THATDONFC committed May 12, 2021
1 parent 46bd40e commit 405a2e8
Show file tree
Hide file tree
Showing 73 changed files with 3,964 additions and 3,549 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
layout python-venv python3
67 changes: 61 additions & 6 deletions .github/workflows/wled-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,37 @@ name: PlatformIO CI
on: [push, pull_request]

jobs:
build:

get_default_envs:
name: Gather Environments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/setup-python@v2
- name: Install PlatformIO
run: pip install -r requirements.txt
- name: Get default environments
id: envs
run: |
echo "::set-output name=environments::$(pio project config --json-output | jq -cr '.[0][1][0][1]')"
outputs:
environments: ${{ steps.envs.outputs.environments }}


build:
name: Build Enviornments
runs-on: ubuntu-latest
needs: get_default_envs
strategy:
matrix:
environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }}
steps:
- uses: actions/checkout@v2
- name: Cache pip
Expand All @@ -24,8 +51,36 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio run
run: pip install -r requirements.txt
- name: Build firmware
env:
WLED_RELEASE: True
run: pio run -e ${{ matrix.environment }}
- uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.environment }}
path: |
build_output/firmware/*.bin
build_output/firmware/*.gz
- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: firmware-release
path: build_output/release/*.bin
release:
name: Create Release
runs-on: ubuntu-latest
needs: [get_default_envs, build]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
with:
name: firmware-release
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
draft: True
files: |
*.bin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ node_modules
.cproject
.project
.idea
.direnv
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@

### Builds after release 0.12.0

#### Build 2105111

- Fixed various Codacy code style and logic issues

#### Build 2105110

- Added Usermod settings page and configurable usermods (PR #1951)
- Added experimental `/json/cfg` endpoint for changing settings from JSON (see #1944, not part of official API)

#### Build 2105070

- Fixed not turning on after pressing "Off" on IR remote twice (#1950)
- Fixed OTA update file selection from Android app (TODO: file type verification in JS, since android can't deal with accept='.bin' attribute)

#### Build 2104220

- Version bump to 0.12.1-b1 "Hikari"
- Release and build script improvements (PR #1844)

#### Build 2104211

- Replace default TV simulator effect with the version that saves 18k of flash and appears visually identical

#### Build 2104210

- Added `tb` to JSON state, allowing setting the timebase (set tb=0 to start e.g. wipe effect from the beginning). Receive only.
- Slightly raised Solid mode refresh rate to work with LEDs (TM1814) that require refresh rates of at least 2fps
- Added sunrise and sunset calculation to the backup JSON time source

#### Build 2104151

- `NUM_STRIPS` no longer required with compile-time strip defaults
- Further optimizations in wled_math.h

#### Build 2104150

- Added ability to add multiple busses as compile time defaults using the esp32_multistrip usermod define syntax

#### Build 2104141

- Reduced memory usage by 540b by switching to a different trigonometric approximation

#### Build 2104140

- Added dynamic location-based Sunrise/Sunset macros (PR #1889)
- Improved seasonal background handling (PR #1890)
- Fixed instance discovery not working if MQTT not compiled in
- Fixed Button, IR, Relay pin not assigned by default (resolves #1891)

#### Build 2104120

- Added switch support (button macro is switch closing action, long press macro switch opening)
- Replaced Circus effect with new Running Dual effect (Circus is Tricolor Chase with Red/White/Black)
- Fixed ledmap with multiple segments (PR #1864)

#### Build 2104030

- Fixed ESP32 crash on Drip effect with reversed segment (#1854)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wled",
"version": "0.12.0",
"version": "0.12.1-b1",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
Expand Down
23 changes: 0 additions & 23 deletions pio-scripts/gzip-firmware.py

This file was deleted.

34 changes: 0 additions & 34 deletions pio-scripts/name-firmware.py

This file was deleted.

69 changes: 69 additions & 0 deletions pio-scripts/output_bins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Import('env')
import os
import shutil
import gzip

OUTPUT_DIR = "build_output{}".format(os.path.sep)

def _get_cpp_define_value(env, define):
define_list = [item[-1] for item in env["CPPDEFINES"] if item[0] == define]

if define_list:
return define_list[0]

return None

def _create_dirs(dirs=["firmware", "map"]):
# check if output directories exist and create if necessary
if not os.path.isdir(OUTPUT_DIR):
os.mkdir(OUTPUT_DIR)

for d in dirs:
if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)):
os.mkdir("{}{}".format(OUTPUT_DIR, d))

def bin_rename_copy(source, target, env):
_create_dirs()
variant = env["PIOENV"]

# create string with location and file names based on variant
map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant)
bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant)

release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME")

if release_name and os.getenv("WLED_RELEASE"):
_create_dirs(["release"])
version = _get_cpp_define_value(env, "WLED_VERSION")
release_file = "{}release{}soundReactive_WLED_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, version, release_name)
shutil.copy(str(target[0]), release_file)

# check if new target files exist and remove if necessary
for f in [map_file, bin_file]:
if os.path.isfile(f):
os.remove(f)

# copy firmware.bin to firmware/<variant>.bin
shutil.copy(str(target[0]), bin_file)

# copy firmware.map to map/<variant>.map
if os.path.isfile("firmware.map"):
shutil.move("firmware.map", map_file)

def bin_gzip(source, target, env):
_create_dirs()
variant = env["PIOENV"]

# create string with location and file names based on variant
bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant)
gzip_file = "{}firmware{}{}.bin.gz".format(OUTPUT_DIR, os.path.sep, variant)

# check if new target files exist and remove if necessary
if os.path.isfile(gzip_file): os.remove(gzip_file)

# write gzip firmware file
with open(bin_file,"rb") as fp:
with gzip.open(gzip_file, "wb", compresslevel = 9) as f:
shutil.copyfileobj(fp, f)

env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_rename_copy, bin_gzip])
8 changes: 8 additions & 0 deletions pio-scripts/set_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Import('env')
import json

PACKAGE_FILE = "package.json"

with open(PACKAGE_FILE, "r") as package:
version = json.load(package)["version"]
env.Append(BUILD_FLAGS=[f"-DWLED_VERSION={version}"])
Loading

0 comments on commit 405a2e8

Please sign in to comment.