Skip to content

Commit cea23d2

Browse files
authored
Merge branch 'wled:main' into main
2 parents 60838a6 + fe33709 commit cea23d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3181
-1187
lines changed

.github/workflows/usermods.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
name: Usermod CI
22

33
on:
4-
push:
5-
paths:
6-
- usermods/**
7-
- .github/workflows/usermods.yml
84
pull_request:
95
paths:
106
- usermods/**
117

128
jobs:
139

1410
get_usermod_envs:
11+
# Only run for pull requests from forks (not from branches within wled/WLED)
12+
if: github.event.pull_request.head.repo.full_name != github.repository
1513
name: Gather Usermods
1614
runs-on: ubuntu-latest
1715
steps:
@@ -31,6 +29,8 @@ jobs:
3129

3230

3331
build:
32+
# Only run for pull requests from forks (not from branches within wled/WLED)
33+
if: github.event.pull_request.head.repo.full_name != github.repository
3434
name: Build Enviornments
3535
runs-on: ubuntu-latest
3636
needs: get_usermod_envs

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@ Github will pick up the changes so your PR stays up-to-date.
2929

3030
You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR
3131

32+
### Source Code from an AI agent or bot
33+
> [!IMPORTANT]
34+
> Its OK if you took help from an AI for writing your source code.
35+
>
36+
> However, we expect a few things from you as the person making a contribution to WLED:
37+
* Make sure you really understand the code suggested by the AI, and don't just accept it because it "seems to work".
38+
* Don't let the AI change existing code without double-checking by you as the contributor. Often, the result will not be complete. For example, previous source code comments may be lost.
39+
* Remember that AI are still "Often-Wrong" ;-)
40+
* If you don't feel very confident using English, you can use AI for translating code comments and descriptions into English. AI bots are very good at understanding language. However, always check if the results is correct. The translation might still have wrong technical terms, or errors in some details.
41+
42+
#### best practice with AI:
43+
* As the person who contributes source code to WLED, make sure you understand exactly what the AI generated code does
44+
* best practice: add a comment like ``'// below section of my code was generated by an AI``, when larger parts of your source code were not written by you personally.
45+
* always review translations and code comments for correctness
46+
* always review AI generated source code
47+
* If the AI has rewritten existing code, check that the change is necessary and that nothing has been lost or broken. Also check that previous code comments are still intact.
48+
3249

3350
### Code style
3451

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default_8MB.csv"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3",
10+
"-DARDUINO_USB_CDC_ON_BOOT=1",
11+
"-DARDUINO_RUNNING_CORE=1",
12+
"-DARDUINO_EVENT_RUNNING_CORE=1",
13+
"-DBOARD_HAS_PSRAM"
14+
],
15+
"f_cpu": "240000000L",
16+
"f_flash": "80000000L",
17+
"flash_mode": "qio",
18+
"hwids": [
19+
[
20+
"0x239A",
21+
"0x8125"
22+
],
23+
[
24+
"0x239A",
25+
"0x0125"
26+
],
27+
[
28+
"0x239A",
29+
"0x8126"
30+
]
31+
],
32+
"mcu": "esp32s3",
33+
"variant": "adafruit_matrixportal_esp32s3"
34+
},
35+
"connectivity": [
36+
"bluetooth",
37+
"wifi"
38+
],
39+
"debug": {
40+
"openocd_target": "esp32s3.cfg"
41+
},
42+
"frameworks": [
43+
"arduino",
44+
"espidf"
45+
],
46+
"name": "Adafruit MatrixPortal ESP32-S3 for WLED",
47+
"upload": {
48+
"flash_size": "8MB",
49+
"maximum_ram_size": 327680,
50+
"maximum_size": 8388608,
51+
"use_1200bps_touch": true,
52+
"wait_for_upload_port": true,
53+
"require_upload_port": true,
54+
"speed": 460800
55+
},
56+
"url": "https://www.adafruit.com/product/5778",
57+
"vendor": "Adafruit"
58+
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
},
1515
"repository": {
1616
"type": "git",
17-
"url": "git+https://github.com/wled-dev/WLED.git"
17+
"url": "git+https://github.com/wled/WLED.git"
1818
},
1919
"author": "",
2020
"license": "ISC",
2121
"bugs": {
22-
"url": "https://github.com/wled-dev/WLED/issues"
22+
"url": "https://github.com/wled/WLED/issues"
2323
},
24-
"homepage": "https://github.com/wled-dev/WLED#readme",
24+
"homepage": "https://github.com/wled/WLED#readme",
2525
"dependencies": {
2626
"clean-css": "^5.3.3",
2727
"html-minifier-terser": "^7.2.0",
@@ -31,4 +31,4 @@
3131
"engines": {
3232
"node": ">=20.0.0"
3333
}
34-
}
34+
}

pio-scripts/output_bins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import shutil
44
import gzip
5+
import json
56

67
OUTPUT_DIR = "build_output{}".format(os.path.sep)
78
#OUTPUT_DIR = os.path.join("build_output")
@@ -22,7 +23,8 @@ def create_release(source):
2223
release_name_def = _get_cpp_define_value(env, "WLED_RELEASE_NAME")
2324
if release_name_def:
2425
release_name = release_name_def.replace("\\\"", "")
25-
version = _get_cpp_define_value(env, "WLED_VERSION")
26+
with open("package.json", "r") as package:
27+
version = json.load(package)["version"]
2628
release_file = os.path.join(OUTPUT_DIR, "release", f"WLED_{version}_{release_name}.bin")
2729
release_gz_file = release_file + ".gz"
2830
print(f"Copying {source} to {release_file}")
Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Import('env')
22
import subprocess
3+
import json
34
import re
45

56
def get_github_repo():
@@ -42,7 +43,7 @@ def get_github_repo():
4243

4344
# Check if it's a GitHub URL
4445
if 'github.com' not in remote_url.lower():
45-
return 'unknown'
46+
return None
4647

4748
# Parse GitHub URL patterns:
4849
# https://github.com/owner/repo.git
@@ -63,17 +64,53 @@ def get_github_repo():
6364
if ssh_match:
6465
return ssh_match.group(1)
6566

66-
return 'unknown'
67+
return None
6768

6869
except FileNotFoundError:
6970
# Git CLI is not installed or not in PATH
70-
return 'unknown'
71+
return None
7172
except subprocess.CalledProcessError:
7273
# Git command failed (e.g., not a git repo, no remote, etc.)
73-
return 'unknown'
74+
return None
7475
except Exception:
7576
# Any other unexpected error
76-
return 'unknown'
77+
return None
7778

78-
repo = get_github_repo()
79-
env.Append(BUILD_FLAGS=[f'-DWLED_REPO=\\"{repo}\\"'])
79+
# WLED version is managed by package.json; this is picked up in several places
80+
# - It's integrated in to the UI code
81+
# - Here, for wled_metadata.cpp
82+
# - The output_bins script
83+
# We always take it from package.json to ensure consistency
84+
with open("package.json", "r") as package:
85+
WLED_VERSION = json.load(package)["version"]
86+
87+
def has_def(cppdefs, name):
88+
""" Returns true if a given name is set in a CPPDEFINES collection """
89+
for f in cppdefs:
90+
if isinstance(f, tuple):
91+
f = f[0]
92+
if f == name:
93+
return True
94+
return False
95+
96+
97+
def add_wled_metadata_flags(env, node):
98+
cdefs = env["CPPDEFINES"].copy()
99+
100+
if not has_def(cdefs, "WLED_REPO"):
101+
repo = get_github_repo()
102+
if repo:
103+
cdefs.append(("WLED_REPO", f"\\\"{repo}\\\""))
104+
105+
cdefs.append(("WLED_VERSION", WLED_VERSION))
106+
107+
# This transforms the node in to a Builder; it cannot be modified again
108+
return env.Object(
109+
node,
110+
CPPDEFINES=cdefs
111+
)
112+
113+
env.AddBuildMiddleware(
114+
add_wled_metadata_flags,
115+
"*/wled_metadata.cpp"
116+
)

pio-scripts/set_version.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)