Skip to content

Commit f068327

Browse files
Add option to set module name at runtime, and add extra examples in platformio_overrides.ini (wled#2578)
* Added option to set the name of the module at runtime. * added example how to set number of LEDs at runtime * Example to enable/set IR remote type at runtime * Clarification on how to use platformio_overrides * Example for setting abl milliamp limit at runtime * Corrected example set LED count
1 parent 1bc698a commit f068327

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

platformio_override.ini.sample

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ build_flags = ${common.build_flags_esp8266}
1919
; *** Use custom settings from file my_config.h
2020
-DWLED_USE_MY_CONFIG
2121
; *********************************************************************
22+
;
23+
;
24+
; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above.
25+
;
26+
; disable specific features
2227
; -D WLED_DISABLE_OTA
2328
; -D WLED_DISABLE_ALEXA
2429
; -D WLED_DISABLE_BLYNK
@@ -44,3 +49,15 @@ build_flags = ${common.build_flags_esp8266}
4449
; for the Magic Home LED Controller use PWM pins 5,12,13,15
4550
; for the H801 controller use PINs 15,13,12,14 (W2 = 04)
4651
; for the BW-LT11 controller use PINs 12,4,14,5
52+
;
53+
; set the name of the module - make sure there is a quote-backslash-quote before the name and a backslash-quote-quote after the name
54+
; -D SERVERNAME="\"WLED\""
55+
;
56+
; set the number of LEDs
57+
; -D DEFAULT_LED_COUNT=30
58+
;
59+
; set milliampere limit when using ESP pin to power leds
60+
; -D ABL_MILLIAMPS_DEFAULT =850
61+
;
62+
; enable IR by setting remote type
63+
; -D IRTYPE=0 //0 Remote disabled | 1 24-key RGB | 2 24-key with CT | 3 40-key blue | 4 40-key RGB | 5 21-key RGB | 6 6-key black | 7 9-key red | 8 JSON remote

wled00/wled.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ WLED_GLOBAL uint16_t transitionDelay _INIT(750); // default crossfade duratio
293293
WLED_GLOBAL byte briMultiplier _INIT(100); // % of brightness to set (to limit power, if you set it to 50 and set bri to 255, actual brightness will be 127)
294294

295295
// User Interface CONFIG
296-
WLED_GLOBAL char serverDescription[33] _INIT("WLED"); // Name of module
296+
#ifndef SERVERNAME
297+
WLED_GLOBAL char serverDescription[33] _INIT("WLED"); // Name of module - use default
298+
#else
299+
WLED_GLOBAL char serverDescription[33] _INIT(SERVERNAME); // use predefined name
300+
#endif
297301
WLED_GLOBAL bool syncToggleReceive _INIT(false); // UIs which only have a single button for sync should toggle send+receive if this is true, only send otherwise
298302

299303
// Sync CONFIG

0 commit comments

Comments
 (0)