From b8685f2c39b78286dddd1ad03e19284c9978dde4 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 14 Sep 2024 15:09:47 -0400 Subject: [PATCH 01/64] Convert usermods to static libraries Redesign the usermod system so that usermods are implemented as PlatformIO libraries instead of headers. This permits them to call for dependencies, and eliminates the compiler flags for enabling each one, allowing the build cache to behave better. The usermod list is built using some linker magic to construct a static list in ROM memory. This eliminates the need for wasting SRAM on something fixed at build time. --- pio-scripts/load_usermods.py | 9 + platformio.ini | 35 +- .../{audio_reactive.h => audio_reactive.cpp} | 4 +- usermods/audioreactive/library.json | 17 + usermods/usermod_v2_auto_save/library.json | 8 + ...2_auto_save.h => usermod_v2_auto_save.cpp} | 3 + wled00/fcn_declare.h | 11 +- wled00/um_manager.cpp | 72 +-- wled00/usermod_v2_empty.h | 18 - wled00/usermods_list.cpp | 482 ------------------ wled00/wled.cpp | 3 - 11 files changed, 100 insertions(+), 562 deletions(-) create mode 100644 pio-scripts/load_usermods.py rename usermods/audioreactive/{audio_reactive.h => audio_reactive.cpp} (99%) create mode 100644 usermods/audioreactive/library.json create mode 100644 usermods/usermod_v2_auto_save/library.json rename usermods/usermod_v2_auto_save/{usermod_v2_auto_save.h => usermod_v2_auto_save.cpp} (99%) delete mode 100644 wled00/usermod_v2_empty.h delete mode 100644 wled00/usermods_list.cpp diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py new file mode 100644 index 00000000..ac761131 --- /dev/null +++ b/pio-scripts/load_usermods.py @@ -0,0 +1,9 @@ +Import('env') +usermods = env.GetProjectOption("custom_usermods","") +if usermods: + proj = env.GetProjectConfig() + deps = env.GetProjectOption('lib_deps') + src_dir = proj.get("platformio", "src_dir") + src_dir = src_dir.replace('\\','/') + usermods = [f"{mod} = symlink://{src_dir}/../usermods/{mod}" for mod in usermods.split(" ")] + proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) diff --git a/platformio.ini b/platformio.ini index 0870cde9..1597343d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -114,6 +114,7 @@ extra_scripts = post:pio-scripts/output_bins.py post:pio-scripts/strip-floats.py pre:pio-scripts/user_config_copy.py + pre:pio-scripts/load_usermods.py pre:pio-scripts/build_ui.py ; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging) @@ -170,8 +171,6 @@ lib_deps = ;https://github.com/netmindz/animartrix.git#18bf17389e57c69f11bc8d04ebe1d215422c7fb7 # SHT85 ;robtillaart/SHT85@~0.3.3 - # Audioreactive usermod - ;kosme/arduinoFFT @ 2.0.1 extra_scripts = ${scripts_defaults.extra_scripts} @@ -261,11 +260,11 @@ lib_deps = https://github.com/lorol/LITTLEFS.git https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ${env.lib_deps} -# additional build flags for audioreactive -AR_build_flags = -D USERMOD_AUDIOREACTIVE - -D sqrt_internal=sqrtf ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster) -AR_lib_deps = kosme/arduinoFFT @ 2.0.1 board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs +# additional build flags for audioreactive - must be applied globally +AR_build_flags = -D sqrt_internal=sqrtf ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster) +AR_lib_deps = kosme/arduinoFFT @ 2.0.1 ;; for pre-usermod-library platformio_override compatibility + [esp32_idf_V4] ;; experimental build environment for ESP32 using ESP-IDF 4.4.x / arduino-esp32 v2.0.5 @@ -424,11 +423,11 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME= board = esp32dev platform = ${esp32.platform} platform_packages = ${esp32.platform_packages} +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} - ${esp32.AR_lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} @@ -436,11 +435,11 @@ board_build.partitions = ${esp32.default_partitions} board = esp32dev platform = ${esp32_idf_V4.platform} platform_packages = ${esp32_idf_V4.platform_packages} +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} - ${esp32.AR_lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.large_partitions} board_upload.flash_size = 8MB @@ -452,11 +451,11 @@ board_upload.maximum_size = 8388608 board = esp32dev platform = ${esp32_idf_V4.platform} platform_packages = ${esp32_idf_V4.platform_packages} +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} - ${esp32.AR_lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.extreme_partitions} board_upload.flash_size = 16MB @@ -468,11 +467,11 @@ board_build.flash_mode = dio ;board = esp32dev ;platform = ${esp32.platform} ;platform_packages = ${esp32.platform_packages} +;custom_usermods = audioreactive ;build_unflags = ${common.build_unflags} ;build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_audioreactive\" #-D WLED_DISABLE_BROWNOUT_DET ; ${esp32.AR_build_flags} ;lib_deps = ${esp32.lib_deps} -; ${esp32.AR_lib_deps} ;monitor_filters = esp32_exception_decoder ;board_build.partitions = ${esp32.default_partitions} ;; board_build.f_flash = 80000000L @@ -483,12 +482,12 @@ board = esp32-poe platform = ${esp32.platform} platform_packages = ${esp32.platform_packages} upload_speed = 921600 +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 ; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} - ${esp32.AR_lib_deps} board_build.partitions = ${esp32.default_partitions} [env:esp32_wrover] @@ -499,14 +498,14 @@ board = ttgo-t7-v14-mini32 board_build.f_flash = 80000000L board_build.flash_mode = qio board_build.partitions = ${esp32.extended_partitions} +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_WROVER\" -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ;; Older ESP32 (rev.<3) need a PSRAM fix (increases static RAM used) https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/external-ram.html -D DATA_PINS=25 ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} - ${esp32.AR_lib_deps} - + [env:esp32c3dev] extends = esp32c3 platform = ${esp32c3.platform} @@ -530,6 +529,7 @@ board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB platform = ${esp32s3.platform} platform_packages = ${esp32s3.platform_packages} upload_speed = 921600 +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_16MB_opi\" -D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0 @@ -538,7 +538,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -DBOARD_HAS_PSRAM ${esp32.AR_build_flags} lib_deps = ${esp32s3.lib_deps} - ${esp32.AR_lib_deps} board_build.partitions = ${esp32.extreme_partitions} board_upload.flash_size = 16MB board_upload.maximum_size = 16777216 @@ -553,6 +552,7 @@ board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB platform = ${esp32s3.platform} platform_packages = ${esp32s3.platform_packages} upload_speed = 921600 +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8MB_opi\" -D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0 @@ -561,7 +561,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -DBOARD_HAS_PSRAM ${esp32.AR_build_flags} lib_deps = ${esp32s3.lib_deps} - ${esp32.AR_lib_deps} board_build.partitions = ${esp32.large_partitions} board_build.f_flash = 80000000L board_build.flash_mode = qio @@ -575,6 +574,7 @@ platform_packages = ${esp32s3.platform_packages} board = esp32s3camlcd ;; this is the only standard board with "opi_opi" board_build.arduino.memory_type = opi_opi upload_speed = 921600 +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_WROOM-2\" -D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0 @@ -587,7 +587,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= ${esp32.AR_build_flags} -D SR_DMTYPE=1 -D I2S_SDPIN=13 -D I2S_CKPIN=14 -D I2S_WSPIN=15 -D MCLK_PIN=4 ;; I2S mic lib_deps = ${esp32s3.lib_deps} - ${esp32.AR_lib_deps} board_build.partitions = ${esp32.extreme_partitions} board_upload.flash_size = 16MB @@ -600,6 +599,7 @@ board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM platform = ${esp32s3.platform} platform_packages = ${esp32s3.platform_packages} upload_speed = 921600 +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\" -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB") @@ -608,7 +608,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -D WLED_WATCHDOG_TIMEOUT=0 ${esp32.AR_build_flags} lib_deps = ${esp32s3.lib_deps} - ${esp32.AR_lib_deps} board_build.partitions = ${esp32.default_partitions} board_build.f_flash = 80000000L board_build.flash_mode = qio @@ -621,6 +620,7 @@ board = lolin_s2_mini board_build.partitions = ${esp32.default_partitions} board_build.flash_mode = qio board_build.f_flash = 80000000L +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S2\" -DARDUINO_USB_CDC_ON_BOOT=1 @@ -639,4 +639,3 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME= ; -D STATUSLED=15 ${esp32.AR_build_flags} lib_deps = ${esp32s2.lib_deps} - ${esp32.AR_lib_deps} diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.cpp similarity index 99% rename from usermods/audioreactive/audio_reactive.h rename to usermods/audioreactive/audio_reactive.cpp index 9c463e0a..a5bf782a 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.cpp @@ -1,4 +1,3 @@ -#pragma once #include "wled.h" @@ -2064,3 +2063,6 @@ const char AudioReactive::_digitalmic[] PROGMEM = "digitalmic"; const char AudioReactive::_addPalettes[] PROGMEM = "add-palettes"; const char AudioReactive::UDP_SYNC_HEADER[] PROGMEM = "00002"; // new sync header version, as format no longer compatible with previous structure const char AudioReactive::UDP_SYNC_HEADER_v1[] PROGMEM = "00001"; // old sync header version - need to add backwards-compatibility feature + +static AudioReactive ar_module; +REGISTER_USERMOD(ar_module); diff --git a/usermods/audioreactive/library.json b/usermods/audioreactive/library.json new file mode 100644 index 00000000..658bf943 --- /dev/null +++ b/usermods/audioreactive/library.json @@ -0,0 +1,17 @@ +{ + "name": "audioreactive", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + }, + "dependencies": [ + { + "owner": "kosme", + "name": "arduinoFFT", + "version": "2.0.1", + "platforms": "espressif32" + } + ] +} \ No newline at end of file diff --git a/usermods/usermod_v2_auto_save/library.json b/usermods/usermod_v2_auto_save/library.json new file mode 100644 index 00000000..40676ed5 --- /dev/null +++ b/usermods/usermod_v2_auto_save/library.json @@ -0,0 +1,8 @@ +{ + "name": "auto_save", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+" + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.h b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp similarity index 99% rename from usermods/usermod_v2_auto_save/usermod_v2_auto_save.h rename to usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp index a257413b..2dae867d 100644 --- a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.h +++ b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp @@ -275,3 +275,6 @@ const char AutoSaveUsermod::_autoSaveEnabled[] PROGMEM = "enabled"; const char AutoSaveUsermod::_autoSaveAfterSec[] PROGMEM = "autoSaveAfterSec"; const char AutoSaveUsermod::_autoSavePreset[] PROGMEM = "autoSavePreset"; const char AutoSaveUsermod::_autoSaveApplyOnBoot[] PROGMEM = "autoSaveApplyOnBoot"; + +static AutoSaveUsermod autosave; +REGISTER_USERMOD(autosave); diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index cb21e8c2..cfb18c25 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -381,7 +381,7 @@ class Usermod { protected: um_data_t *um_data; // um_data should be allocated using new in (derived) Usermod's setup() or constructor public: - Usermod() { um_data = nullptr; } + Usermod() : um_data(nullptr) {}; virtual ~Usermod() { if (um_data) delete um_data; } virtual void setup() = 0; // pure virtual, has to be overriden virtual void loop() = 0; // pure virtual, has to be overriden @@ -418,8 +418,6 @@ class Usermod { }; namespace UsermodManager { - extern byte numMods; - void loop(); void handleOverlayDraw(); bool handleButton(uint8_t b); @@ -441,13 +439,12 @@ namespace UsermodManager { #endif void onUpdateBegin(bool); void onStateChange(uint8_t); - bool add(Usermod* um); Usermod* lookup(uint16_t mod_id); - inline byte getModCount() {return numMods;}; + size_t getModCount(); }; -//usermods_list.cpp -void registerUsermods(); +// Register usermods by building a static list via a linker section +#define REGISTER_USERMOD(x) Usermod* const um_##x __attribute__((__section__(".dtors.tbl.usermods.1"), used)) = &x //usermod.cpp void userSetup(); diff --git a/wled00/um_manager.cpp b/wled00/um_manager.cpp index 1fdb6d68..9bfb7e73 100644 --- a/wled00/um_manager.cpp +++ b/wled00/um_manager.cpp @@ -3,75 +3,81 @@ * Registration and management utility for v2 usermods */ -static Usermod* ums[WLED_MAX_USERMODS] = {nullptr}; -byte UsermodManager::numMods = 0; +// Global usermod instance list +// Table begin and end references +// Zero-length arrays -- so they'll get assigned addresses, but consume no flash +// The numeric suffix ensures they're put in the right place; the linker script will sort them +// We stick them in the '.dtors' segment because it's always included by the linker scripts +// even though it never gets called. Who calls exit() in an embedded program anyways? +// If someone ever does, though, it'll explode as these aren't function pointers. +static Usermod * const _usermod_table_begin[0] __attribute__((__section__(".dtors.tbl.usermods.0"), unused)) = {}; +static Usermod * const _usermod_table_end[0] __attribute__((__section__(".dtors.tbl.usermods.99"), unused)) = {}; + +static size_t getCount() { + return &_usermod_table_end[0] - &_usermod_table_begin[0]; +} + //Usermod Manager internals -void UsermodManager::setup() { for (unsigned i = 0; i < numMods; i++) ums[i]->setup(); } -void UsermodManager::connected() { for (unsigned i = 0; i < numMods; i++) ums[i]->connected(); } -void UsermodManager::loop() { for (unsigned i = 0; i < numMods; i++) ums[i]->loop(); } -void UsermodManager::handleOverlayDraw() { for (unsigned i = 0; i < numMods; i++) ums[i]->handleOverlayDraw(); } -void UsermodManager::appendConfigData(Print& dest) { for (unsigned i = 0; i < numMods; i++) ums[i]->appendConfigData(dest); } +void UsermodManager::setup() { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->setup(); } +void UsermodManager::connected() { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->connected(); } +void UsermodManager::loop() { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->loop(); } +void UsermodManager::handleOverlayDraw() { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->handleOverlayDraw(); } +void UsermodManager::appendConfigData(Print& dest) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->appendConfigData(dest); } bool UsermodManager::handleButton(uint8_t b) { bool overrideIO = false; - for (unsigned i = 0; i < numMods; i++) { - if (ums[i]->handleButton(b)) overrideIO = true; + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) { + if ((*mod)->handleButton(b)) overrideIO = true; } return overrideIO; } bool UsermodManager::getUMData(um_data_t **data, uint8_t mod_id) { - for (unsigned i = 0; i < numMods; i++) { - if (mod_id > 0 && ums[i]->getId() != mod_id) continue; // only get data form requested usermod if provided - if (ums[i]->getUMData(data)) return true; // if usermod does provide data return immediately (only one usermod can provide data at one time) + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) { + if (mod_id > 0 && (*mod)->getId() != mod_id) continue; // only get data form requested usermod if provided + if ((*mod)->getUMData(data)) return true; // if usermod does provide data return immediately (only one usermod can provide data at one time) } return false; } -void UsermodManager::addToJsonState(JsonObject& obj) { for (unsigned i = 0; i < numMods; i++) ums[i]->addToJsonState(obj); } -void UsermodManager::addToJsonInfo(JsonObject& obj) { for (unsigned i = 0; i < numMods; i++) ums[i]->addToJsonInfo(obj); } -void UsermodManager::readFromJsonState(JsonObject& obj) { for (unsigned i = 0; i < numMods; i++) ums[i]->readFromJsonState(obj); } -void UsermodManager::addToConfig(JsonObject& obj) { for (unsigned i = 0; i < numMods; i++) ums[i]->addToConfig(obj); } +void UsermodManager::addToJsonState(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->addToJsonState(obj); } +void UsermodManager::addToJsonInfo(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->addToJsonInfo(obj); } +void UsermodManager::readFromJsonState(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->readFromJsonState(obj); } +void UsermodManager::addToConfig(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->addToConfig(obj); } bool UsermodManager::readFromConfig(JsonObject& obj) { bool allComplete = true; - for (unsigned i = 0; i < numMods; i++) { - if (!ums[i]->readFromConfig(obj)) allComplete = false; + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) { + if (!(*mod)->readFromConfig(obj)) allComplete = false; } return allComplete; } #ifndef WLED_DISABLE_MQTT -void UsermodManager::onMqttConnect(bool sessionPresent) { for (unsigned i = 0; i < numMods; i++) ums[i]->onMqttConnect(sessionPresent); } +void UsermodManager::onMqttConnect(bool sessionPresent) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->onMqttConnect(sessionPresent); } bool UsermodManager::onMqttMessage(char* topic, char* payload) { - for (unsigned i = 0; i < numMods; i++) if (ums[i]->onMqttMessage(topic, payload)) return true; + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) if ((*mod)->onMqttMessage(topic, payload)) return true; return false; } #endif #ifndef WLED_DISABLE_ESPNOW bool UsermodManager::onEspNowMessage(uint8_t* sender, uint8_t* payload, uint8_t len) { - for (unsigned i = 0; i < numMods; i++) if (ums[i]->onEspNowMessage(sender, payload, len)) return true; + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) if ((*mod)->onEspNowMessage(sender, payload, len)) return true; return false; } #endif -void UsermodManager::onUpdateBegin(bool init) { for (unsigned i = 0; i < numMods; i++) ums[i]->onUpdateBegin(init); } // notify usermods that update is to begin -void UsermodManager::onStateChange(uint8_t mode) { for (unsigned i = 0; i < numMods; i++) ums[i]->onStateChange(mode); } // notify usermods that WLED state changed +void UsermodManager::onUpdateBegin(bool init) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->onUpdateBegin(init); } // notify usermods that update is to begin +void UsermodManager::onStateChange(uint8_t mode) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->onStateChange(mode); } // notify usermods that WLED state changed /* * Enables usermods to lookup another Usermod. */ Usermod* UsermodManager::lookup(uint16_t mod_id) { - for (unsigned i = 0; i < numMods; i++) { - if (ums[i]->getId() == mod_id) { - return ums[i]; + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) { + if ((*mod)->getId() == mod_id) { + return *mod; } } return nullptr; } -bool UsermodManager::add(Usermod* um) -{ - if (numMods >= WLED_MAX_USERMODS || um == nullptr) return false; - ums[numMods++] = um; - return true; -} - +size_t UsermodManager::getModCount() { return getCount(); }; /* Usermod v2 interface shim for oappend */ Print* Usermod::oappend_shim = nullptr; diff --git a/wled00/usermod_v2_empty.h b/wled00/usermod_v2_empty.h deleted file mode 100644 index 6537b56b..00000000 --- a/wled00/usermod_v2_empty.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "wled.h" - -//This is an empty v2 usermod template. Please see the file usermod_v2_example.h in the EXAMPLE_v2 usermod folder for documentation on the functions you can use! - -class UsermodRenameMe : public Usermod { - private: - - public: - void setup() { - - } - - void loop() { - - } -}; \ No newline at end of file diff --git a/wled00/usermods_list.cpp b/wled00/usermods_list.cpp deleted file mode 100644 index 627fa630..00000000 --- a/wled00/usermods_list.cpp +++ /dev/null @@ -1,482 +0,0 @@ -#include "wled.h" -/* - * Register your v2 usermods here! - * (for v1 usermods using just usermod.cpp, you can ignore this file) - */ - -/* - * Add/uncomment your usermod filename here (and once more below) - * || || || - * \/ \/ \/ - */ -//#include "../usermods/EXAMPLE_v2/usermod_v2_example.h" - -#ifdef USERMOD_BATTERY - #include "../usermods/Battery/usermod_v2_Battery.h" -#endif - -#ifdef USERMOD_DALLASTEMPERATURE - #include "../usermods/Temperature/usermod_temperature.h" -#endif - -#ifdef USERMOD_SHT -#include "../usermods/sht/usermod_sht.h" -#endif - -#ifdef USERMOD_SN_PHOTORESISTOR - #include "../usermods/SN_Photoresistor/usermod_sn_photoresistor.h" -#endif - -#ifdef USERMOD_PWM_FAN - // requires DALLASTEMPERATURE or SHT included before it - #include "../usermods/PWM_fan/usermod_PWM_fan.h" -#endif - -#ifdef USERMOD_BUZZER - #include "../usermods/buzzer/usermod_v2_buzzer.h" -#endif - -#ifdef USERMOD_SENSORSTOMQTT - #include "../usermods/sensors_to_mqtt/usermod_v2_SensorsToMqtt.h" -#endif - -#ifdef USERMOD_PIRSWITCH - #include "../usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h" -#endif - -#ifdef USERMOD_BH1750 - #include "../usermods/BH1750_v2/usermod_bh1750.h" -#endif - -// BME280 v2 usermod. Define "USERMOD_BME280" in my_config.h -#ifdef USERMOD_BME280 - #include "../usermods/BME280_v2/usermod_bme280.h" -#endif - -#ifdef USERMOD_BME68X - #include "../usermods/BME68X_v2/usermod_bme68x.h" -#endif - - -#ifdef USERMOD_FOUR_LINE_DISPLAY - #include "../usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h" -#endif - -#ifdef USERMOD_ROTARY_ENCODER_UI - #include "../usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h" -#endif - -#ifdef USERMOD_AUTO_SAVE - #include "../usermods/usermod_v2_auto_save/usermod_v2_auto_save.h" -#endif - -#ifdef USERMOD_DHT - #include "../usermods/DHT/usermod_dht.h" -#endif - -#ifdef USERMOD_VL53L0X_GESTURES - #include "../usermods/VL53L0X_gestures/usermod_vl53l0x_gestures.h" -#endif - -#ifdef USERMOD_ANIMATED_STAIRCASE - #include "../usermods/Animated_Staircase/Animated_Staircase.h" -#endif - -#ifdef USERMOD_MULTI_RELAY - #include "../usermods/multi_relay/usermod_multi_relay.h" -#endif - -#ifdef USERMOD_RTC - #include "../usermods/RTC/usermod_rtc.h" -#endif - -#ifdef USERMOD_ELEKSTUBE_IPS - #include "../usermods/EleksTube_IPS/usermod_elekstube_ips.h" -#endif - -#ifdef USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR - #include "../usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.h" -#endif - -#ifdef RGB_ROTARY_ENCODER - #include "../usermods/rgb-rotary-encoder/rgb-rotary-encoder.h" -#endif - -#ifdef USERMOD_ST7789_DISPLAY - #include "../usermods/ST7789_display/ST7789_Display.h" -#endif - -#ifdef USERMOD_PIXELS_DICE_TRAY - #include "../usermods/pixels_dice_tray/pixels_dice_tray.h" -#endif - -#ifdef USERMOD_SEVEN_SEGMENT - #include "../usermods/seven_segment_display/usermod_v2_seven_segment_display.h" -#endif - -#ifdef USERMOD_SSDR - #include "../usermods/seven_segment_display_reloaded/usermod_seven_segment_reloaded.h" -#endif - -#ifdef USERMOD_CRONIXIE - #include "../usermods/Cronixie/usermod_cronixie.h" -#endif - -#ifdef QUINLED_AN_PENTA - #include "../usermods/quinled-an-penta/quinled-an-penta.h" -#endif - -#ifdef USERMOD_WIZLIGHTS - #include "../usermods/wizlights/wizlights.h" -#endif - -#ifdef USERMOD_WIREGUARD - #include "../usermods/wireguard/wireguard.h" -#endif - -#ifdef USERMOD_WORDCLOCK - #include "../usermods/usermod_v2_word_clock/usermod_v2_word_clock.h" -#endif - -#ifdef USERMOD_MY9291 - #include "../usermods/MY9291/usermode_MY9291.h" -#endif - -#ifdef USERMOD_SI7021_MQTT_HA - #include "../usermods/Si7021_MQTT_HA/usermod_si7021_mqtt_ha.h" -#endif - -#ifdef USERMOD_SMARTNEST - #include "../usermods/smartnest/usermod_smartnest.h" -#endif - -#ifdef USERMOD_AUDIOREACTIVE - #include "../usermods/audioreactive/audio_reactive.h" -#endif - -#ifdef USERMOD_ANALOG_CLOCK - #include "../usermods/Analog_Clock/Analog_Clock.h" -#endif - -#ifdef USERMOD_PING_PONG_CLOCK - #include "../usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.h" -#endif - -#ifdef USERMOD_ADS1115 - #include "../usermods/ADS1115_v2/usermod_ads1115.h" -#endif - -#ifdef USERMOD_KLIPPER_PERCENTAGE - #include "../usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.h" -#endif - -#ifdef USERMOD_BOBLIGHT - #include "../usermods/boblight/boblight.h" -#endif - -#ifdef USERMOD_ANIMARTRIX - #include "../usermods/usermod_v2_animartrix/usermod_v2_animartrix.h" -#endif - -#ifdef USERMOD_INTERNAL_TEMPERATURE - #include "../usermods/Internal_Temperature_v2/usermod_internal_temperature.h" -#endif - -#if defined(WLED_USE_SD_MMC) || defined(WLED_USE_SD_SPI) -// This include of SD.h and SD_MMC.h must happen here, else they won't be -// resolved correctly (when included in mod's header only) - #ifdef WLED_USE_SD_MMC - #include "SD_MMC.h" - #elif defined(WLED_USE_SD_SPI) - #include "SD.h" - #include "SPI.h" - #endif - #include "../usermods/sd_card/usermod_sd_card.h" -#endif - -#ifdef USERMOD_PWM_OUTPUTS - #include "../usermods/pwm_outputs/usermod_pwm_outputs.h" -#endif - -#ifdef USERMOD_HTTP_PULL_LIGHT_CONTROL - #include "../usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.h" -#endif - -#ifdef USERMOD_MPU6050_IMU - #include "../usermods/mpu6050_imu/usermod_mpu6050_imu.h" -#endif - -#ifdef USERMOD_MPU6050_IMU - #include "../usermods/mpu6050_imu/usermod_gyro_surge.h" -#endif - -#ifdef USERMOD_LDR_DUSK_DAWN - #include "../usermods/LDR_Dusk_Dawn_v2/usermod_LDR_Dusk_Dawn_v2.h" -#endif - -#ifdef USERMOD_POV_DISPLAY - #include "../usermods/pov_display/usermod_pov_display.h" -#endif - -#ifdef USERMOD_STAIRCASE_WIPE - #include "../usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h" -#endif - -#ifdef USERMOD_MAX17048 - #include "../usermods/MAX17048_v2/usermod_max17048.h" -#endif - -#ifdef USERMOD_TETRISAI - #include "../usermods/TetrisAI_v2/usermod_v2_tetrisai.h" -#endif - -#ifdef USERMOD_AHT10 - #include "../usermods/AHT10_v2/usermod_aht10.h" -#endif - -#ifdef USERMOD_INA226 - #include "../usermods/INA226_v2/usermod_ina226.h" -#endif - -#ifdef USERMOD_LD2410 -#include "../usermods/LD2410_v2/usermod_ld2410.h" -#endif - - -#ifdef USERMOD_DEEP_SLEEP - #include "../usermods/deep_sleep/usermod_deep_sleep.h" -#endif - -void registerUsermods() -{ -/* - * Add your usermod class name here - * || || || - * \/ \/ \/ - */ - //UsermodManager::add(new MyExampleUsermod()); - - #ifdef USERMOD_BATTERY - UsermodManager::add(new UsermodBattery()); - #endif - - #ifdef USERMOD_DALLASTEMPERATURE - UsermodManager::add(new UsermodTemperature()); - #endif - - #ifdef USERMOD_SN_PHOTORESISTOR - UsermodManager::add(new Usermod_SN_Photoresistor()); - #endif - - #ifdef USERMOD_PWM_FAN - UsermodManager::add(new PWMFanUsermod()); - #endif - - #ifdef USERMOD_BUZZER - UsermodManager::add(new BuzzerUsermod()); - #endif - - #ifdef USERMOD_BH1750 - UsermodManager::add(new Usermod_BH1750()); - #endif - - #ifdef USERMOD_BME280 - UsermodManager::add(new UsermodBME280()); - #endif - - #ifdef USERMOD_BME68X - UsermodManager::add(new UsermodBME68X()); - #endif - - #ifdef USERMOD_SENSORSTOMQTT - UsermodManager::add(new UserMod_SensorsToMQTT()); - #endif - - #ifdef USERMOD_PIRSWITCH - UsermodManager::add(new PIRsensorSwitch()); - #endif - - #ifdef USERMOD_FOUR_LINE_DISPLAY - UsermodManager::add(new FourLineDisplayUsermod()); - #endif - - #ifdef USERMOD_ROTARY_ENCODER_UI - UsermodManager::add(new RotaryEncoderUIUsermod()); // can use USERMOD_FOUR_LINE_DISPLAY - #endif - - #ifdef USERMOD_AUTO_SAVE - UsermodManager::add(new AutoSaveUsermod()); // can use USERMOD_FOUR_LINE_DISPLAY - #endif - - #ifdef USERMOD_DHT - UsermodManager::add(new UsermodDHT()); - #endif - - #ifdef USERMOD_VL53L0X_GESTURES - UsermodManager::add(new UsermodVL53L0XGestures()); - #endif - - #ifdef USERMOD_ANIMATED_STAIRCASE - UsermodManager::add(new Animated_Staircase()); - #endif - - #ifdef USERMOD_MULTI_RELAY - UsermodManager::add(new MultiRelay()); - #endif - - #ifdef USERMOD_RTC - UsermodManager::add(new RTCUsermod()); - #endif - - #ifdef USERMOD_ELEKSTUBE_IPS - UsermodManager::add(new ElekstubeIPSUsermod()); - #endif - - #ifdef USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR - UsermodManager::add(new RotaryEncoderBrightnessColor()); - #endif - - #ifdef RGB_ROTARY_ENCODER - UsermodManager::add(new RgbRotaryEncoderUsermod()); - #endif - - #ifdef USERMOD_ST7789_DISPLAY - UsermodManager::add(new St7789DisplayUsermod()); - #endif - - #ifdef USERMOD_PIXELS_DICE_TRAY - UsermodManager::add(new PixelsDiceTrayUsermod()); - #endif - - #ifdef USERMOD_SEVEN_SEGMENT - UsermodManager::add(new SevenSegmentDisplay()); - #endif - - #ifdef USERMOD_SSDR - UsermodManager::add(new UsermodSSDR()); - #endif - - #ifdef USERMOD_CRONIXIE - UsermodManager::add(new UsermodCronixie()); - #endif - - #ifdef QUINLED_AN_PENTA - UsermodManager::add(new QuinLEDAnPentaUsermod()); - #endif - - #ifdef USERMOD_WIZLIGHTS - UsermodManager::add(new WizLightsUsermod()); - #endif - - #ifdef USERMOD_WIREGUARD - UsermodManager::add(new WireguardUsermod()); - #endif - - #ifdef USERMOD_WORDCLOCK - UsermodManager::add(new WordClockUsermod()); - #endif - - #ifdef USERMOD_MY9291 - UsermodManager::add(new MY9291Usermod()); - #endif - - #ifdef USERMOD_SI7021_MQTT_HA - UsermodManager::add(new Si7021_MQTT_HA()); - #endif - - #ifdef USERMOD_SMARTNEST - UsermodManager::add(new Smartnest()); - #endif - - #ifdef USERMOD_AUDIOREACTIVE - UsermodManager::add(new AudioReactive()); - #endif - - #ifdef USERMOD_ANALOG_CLOCK - UsermodManager::add(new AnalogClockUsermod()); - #endif - - #ifdef USERMOD_PING_PONG_CLOCK - UsermodManager::add(new PingPongClockUsermod()); - #endif - - #ifdef USERMOD_ADS1115 - UsermodManager::add(new ADS1115Usermod()); - #endif - - #ifdef USERMOD_KLIPPER_PERCENTAGE - UsermodManager::add(new klipper_percentage()); - #endif - - #ifdef USERMOD_BOBLIGHT - UsermodManager::add(new BobLightUsermod()); - #endif - - #ifdef SD_ADAPTER - UsermodManager::add(new UsermodSdCard()); - #endif - - #ifdef USERMOD_PWM_OUTPUTS - UsermodManager::add(new PwmOutputsUsermod()); - #endif - - #ifdef USERMOD_SHT - UsermodManager::add(new ShtUsermod()); - #endif - - #ifdef USERMOD_ANIMARTRIX - UsermodManager::add(new AnimartrixUsermod("Animartrix", false)); - #endif - - #ifdef USERMOD_INTERNAL_TEMPERATURE - UsermodManager::add(new InternalTemperatureUsermod()); - #endif - - #ifdef USERMOD_HTTP_PULL_LIGHT_CONTROL - UsermodManager::add(new HttpPullLightControl()); - #endif - - #ifdef USERMOD_MPU6050_IMU - static MPU6050Driver mpu6050; UsermodManager::add(&mpu6050); - #endif - - #ifdef USERMOD_GYRO_SURGE - static GyroSurge gyro_surge; UsermodManager::add(&gyro_surge); - #endif - - #ifdef USERMOD_LDR_DUSK_DAWN - UsermodManager::add(new LDR_Dusk_Dawn_v2()); - #endif - - #ifdef USERMOD_STAIRCASE_WIPE - UsermodManager::add(new StairwayWipeUsermod()); - #endif - - #ifdef USERMOD_MAX17048 - UsermodManager::add(new Usermod_MAX17048()); - #endif - - #ifdef USERMOD_TETRISAI - UsermodManager::add(new TetrisAIUsermod()); - #endif - - #ifdef USERMOD_AHT10 - UsermodManager::add(new UsermodAHT10()); - #endif - - #ifdef USERMOD_INA226 - UsermodManager::add(new UsermodINA226()); - #endif - - #ifdef USERMOD_LD2410 - UsermodManager::add(new LD2410Usermod()); - #endif - - #ifdef USERMOD_POV_DISPLAY - UsermodManager::add(new PovDisplayUsermod()); - #endif - - #ifdef USERMOD_DEEP_SLEEP - usermods.add(new DeepSleepUsermod()); - #endif -} diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 1f978a39..3b8c6009 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -424,9 +424,6 @@ void WLED::setup() PinManager::allocatePin(2, true, PinOwner::DMX); #endif - DEBUG_PRINTLN(F("Registering usermods ...")); - registerUsermods(); - DEBUG_PRINTF_P(PSTR("heap %u\n"), ESP.getFreeHeap()); bool fsinit = false; From 4d5e0ca7a3a1b9914621813f6cb8827dd33a5c32 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 11 Jan 2025 13:31:20 -0500 Subject: [PATCH 02/64] load_usermods: Expand name search Look for 'usermod_v2_x' as well. This could be removed later if we clean up the folder names. --- pio-scripts/load_usermods.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index ac761131..55b9c4b1 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -1,9 +1,26 @@ Import('env') +import os + +def find_usermod(mod_dir: str, mod: str): + """Locate this library in the usermods folder. + We do this to avoid needing to rename a bunch of folders; + this could be removed later + """ + # Check name match + mp = f"{mod_dir}/{mod}" + if os.path.exists(mp): + return mp + mp = f"{mod_dir}/usermod_v2_{mod}" + if os.path.exists(mp): + return mp + raise RuntimeError(f"Couldn't locate module {mod} in usermods directory!") + usermods = env.GetProjectOption("custom_usermods","") if usermods: proj = env.GetProjectConfig() deps = env.GetProjectOption('lib_deps') src_dir = proj.get("platformio", "src_dir") src_dir = src_dir.replace('\\','/') - usermods = [f"{mod} = symlink://{src_dir}/../usermods/{mod}" for mod in usermods.split(" ")] + mod_paths = {mod: find_usermod(f"{src_dir}/../usermods", mod) for mod in usermods.split(" ")} + usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()] proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) From 71b0e8e93745bb906d0f1f6eb9d161c4a1499e3d Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 11 Jan 2025 13:32:28 -0500 Subject: [PATCH 03/64] Convert AnimARTrix usermod to library Borrowed library definition from @netmindz's work on #4476. --- platformio.ini | 3 --- usermods/usermod_v2_animartrix/library.json | 12 ++++++++++++ usermods/usermod_v2_animartrix/readme.md | 6 +----- ...mod_v2_animartrix.h => usermod_v2_animartrix.cpp} | 5 ++--- 4 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 usermods/usermod_v2_animartrix/library.json rename usermods/usermod_v2_animartrix/{usermod_v2_animartrix.h => usermod_v2_animartrix.cpp} (99%) diff --git a/platformio.ini b/platformio.ini index 1597343d..4832978a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -166,9 +166,6 @@ lib_deps = ; https://github.com/adafruit/Adafruit_MAX1704X @ 1.0.2 #For MPU6050 IMU uncomment follwoing ;electroniccats/MPU6050 @1.0.1 - # For -D USERMOD_ANIMARTRIX - # CC BY-NC 3.0 licensed effects by Stefan Petrick, include this usermod only if you accept the terms! - ;https://github.com/netmindz/animartrix.git#18bf17389e57c69f11bc8d04ebe1d215422c7fb7 # SHT85 ;robtillaart/SHT85@~0.3.3 diff --git a/usermods/usermod_v2_animartrix/library.json b/usermods/usermod_v2_animartrix/library.json new file mode 100644 index 00000000..f176e72e --- /dev/null +++ b/usermods/usermod_v2_animartrix/library.json @@ -0,0 +1,12 @@ +{ + "name": "animartrix", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + }, + "dependencies": { + "Animartrix": "https://github.com/netmindz/animartrix.git#b172586" + } +} diff --git a/usermods/usermod_v2_animartrix/readme.md b/usermods/usermod_v2_animartrix/readme.md index 42d463c5..f0ff60a7 100644 --- a/usermods/usermod_v2_animartrix/readme.md +++ b/usermods/usermod_v2_animartrix/readme.md @@ -6,9 +6,5 @@ CC BY-NC 3.0 licensed effects by Stefan Petrick, include this usermod only if yo ## Installation -Please uncomment the two references to ANIMartRIX in your platform.ini - -lib_dep to a version of https://github.com/netmindz/animartrix.git -and the build_flags -D USERMOD_ANIMARTRIX - +Add 'animartrix' to 'custom_usermods' in your platformio_override.ini. diff --git a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp similarity index 99% rename from usermods/usermod_v2_animartrix/usermod_v2_animartrix.h rename to usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp index d91cf6c9..d2968f2f 100644 --- a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h +++ b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include @@ -452,5 +450,6 @@ class AnimartrixUsermod : public Usermod { }; - +static AnimartrixUsermod animartrix_module("Animartrix", false); +REGISTER_USERMOD(animartrix_module); From 90b18158fc636f420a091893ea71075e86af72e5 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 21:14:20 +0000 Subject: [PATCH 04/64] Convert usermods from header to library --- .../Analog_Clock/{Analog_Clock.h => Analog_Clock.cpp} | 4 ++++ usermods/Analog_Clock/library.json | 9 +++++++++ .../{Animated_Staircase.h => Animated_Staircase.cpp} | 4 ++++ usermods/Animated_Staircase/library.json | 9 +++++++++ usermods/Battery/{usermod_v2_Battery.h => Battery.cpp} | 4 ++++ usermods/Battery/library.json | 9 +++++++++ usermods/Cronixie/{usermod_cronixie.h => Cronixie.cpp} | 5 ++++- usermods/Cronixie/library.json | 9 +++++++++ usermods/DHT/{usermod_dht.h => DHT.cpp} | 4 ++++ usermods/DHT/library.json | 9 +++++++++ .../{usermod_elekstube_ips.h => EleksTube_IPS.cpp} | 4 ++++ usermods/EleksTube_IPS/library.json | 9 +++++++++ .../{usermod_LDR_Dusk_Dawn_v2.h => LDR_Dusk_Dawn_v2.cpp} | 4 ++++ usermods/LDR_Dusk_Dawn_v2/library.json | 9 +++++++++ ...usermod_PIR_sensor_switch.h => PIR_sensor_switch.cpp} | 4 ++++ usermods/PIR_sensor_switch/library.json | 9 +++++++++ usermods/PWM_fan/{usermod_PWM_fan.h => PWM_fan.cpp} | 4 ++++ usermods/PWM_fan/library.json | 9 +++++++++ usermods/RTC/{usermod_rtc.h => RTC.cpp} | 5 ++++- usermods/RTC/library.json | 9 +++++++++ .../{usermod_sn_photoresistor.h => SN_Photoresistor.cpp} | 4 ++++ usermods/SN_Photoresistor/library.json | 9 +++++++++ .../{ST7789_display.h => ST7789_display.cpp} | 5 ++++- usermods/ST7789_display/library.json | 9 +++++++++ .../{usermod_si7021_mqtt_ha.h => Si7021_MQTT_HA.cpp} | 4 ++++ usermods/Si7021_MQTT_HA/library.json | 9 +++++++++ .../{usermod_temperature.h => Temperature.cpp} | 4 ++++ usermods/Temperature/library.json | 9 +++++++++ .../{usermod_vl53l0x_gestures.h => VL53L0X_gestures.cpp} | 5 ++++- usermods/VL53L0X_gestures/library.json | 9 +++++++++ usermods/boblight/{boblight.h => boblight.cpp} | 4 ++++ usermods/boblight/library.json | 9 +++++++++ usermods/buzzer/{usermod_v2_buzzer.h => buzzer.cpp} | 5 ++++- usermods/buzzer/library.json | 9 +++++++++ .../deep_sleep/{usermod_deep_sleep.h => deep_sleep.cpp} | 5 ++++- usermods/deep_sleep/library.json | 9 +++++++++ usermods/mpu6050_imu/library.json | 9 +++++++++ .../{usermod_mpu6050_imu.h => mpu6050_imu.cpp} | 4 ++++ usermods/multi_relay/library.json | 9 +++++++++ .../{usermod_multi_relay.h => multi_relay.cpp} | 4 ++++ usermods/pixels_dice_tray/library.json | 9 +++++++++ .../{pixels_dice_tray.h => pixels_dice_tray.cpp} | 4 ++++ usermods/pov_display/library.json | 9 +++++++++ .../{usermod_pov_display.h => pov_display.cpp} | 4 ++++ usermods/pwm_outputs/library.json | 9 +++++++++ .../{usermod_pwm_outputs.h => pwm_outputs.cpp} | 4 ++++ usermods/quinled-an-penta/library.json | 9 +++++++++ .../{quinled-an-penta.h => quinled-an-penta.cpp} | 5 ++++- usermods/rgb-rotary-encoder/library.json | 9 +++++++++ .../{rgb-rotary-encoder.h => rgb-rotary-encoder.cpp} | 5 ++++- usermods/sd_card/library.json | 9 +++++++++ usermods/sd_card/{usermod_sd_card.h => sd_card.cpp} | 5 ++++- usermods/seven_segment_display/library.json | 9 +++++++++ ...seven_segment_display.h => seven_segment_display.cpp} | 5 ++++- usermods/sht/library.json | 9 +++++++++ usermods/sht/{usermod_sht.h => sht.cpp} | 5 ++++- usermods/smartnest/library.json | 9 +++++++++ .../smartnest/{usermod_smartnest.h => smartnest.cpp} | 4 ++++ usermods/usermod_rotary_brightness_color/library.json | 9 +++++++++ ...tness_color.h => usermod_rotary_brightness_color.cpp} | 4 ++++ usermods/usermod_v2_HttpPullLightControl/library.json | 9 +++++++++ usermods/usermod_v2_four_line_display_ALT/library.json | 9 +++++++++ ...isplay_ALT.h => usermod_v2_four_line_display_ALT.cpp} | 4 ++++ usermods/usermod_v2_klipper_percentage/library.json | 9 +++++++++ ...er_percentage.h => usermod_v2_klipper_percentage.cpp} | 5 ++++- usermods/usermod_v2_ping_pong_clock/library.json | 9 +++++++++ ..._ping_pong_clock.h => usermod_v2_ping_pong_clock.cpp} | 4 ++++ usermods/usermod_v2_rotary_encoder_ui_ALT/library.json | 9 +++++++++ ...der_ui_ALT.h => usermod_v2_rotary_encoder_ui_ALT.cpp} | 4 ++++ usermods/usermod_v2_word_clock/library.json | 9 +++++++++ ...usermod_v2_word_clock.h => usermod_v2_word_clock.cpp} | 5 ++++- usermods/wireguard/library.json | 9 +++++++++ usermods/wireguard/{wireguard.h => wireguard.cpp} | 5 ++++- usermods/wizlights/library.json | 9 +++++++++ usermods/wizlights/{wizlights.h => wizlights.cpp} | 4 ++++ 75 files changed, 490 insertions(+), 14 deletions(-) rename usermods/Analog_Clock/{Analog_Clock.h => Analog_Clock.cpp} (99%) create mode 100644 usermods/Analog_Clock/library.json rename usermods/Animated_Staircase/{Animated_Staircase.h => Animated_Staircase.cpp} (99%) create mode 100644 usermods/Animated_Staircase/library.json rename usermods/Battery/{usermod_v2_Battery.h => Battery.cpp} (99%) create mode 100644 usermods/Battery/library.json rename usermods/Cronixie/{usermod_cronixie.h => Cronixie.cpp} (99%) create mode 100644 usermods/Cronixie/library.json rename usermods/DHT/{usermod_dht.h => DHT.cpp} (99%) create mode 100644 usermods/DHT/library.json rename usermods/EleksTube_IPS/{usermod_elekstube_ips.h => EleksTube_IPS.cpp} (98%) create mode 100644 usermods/EleksTube_IPS/library.json rename usermods/LDR_Dusk_Dawn_v2/{usermod_LDR_Dusk_Dawn_v2.h => LDR_Dusk_Dawn_v2.cpp} (98%) create mode 100644 usermods/LDR_Dusk_Dawn_v2/library.json rename usermods/PIR_sensor_switch/{usermod_PIR_sensor_switch.h => PIR_sensor_switch.cpp} (96%) create mode 100644 usermods/PIR_sensor_switch/library.json rename usermods/PWM_fan/{usermod_PWM_fan.h => PWM_fan.cpp} (99%) create mode 100644 usermods/PWM_fan/library.json rename usermods/RTC/{usermod_rtc.h => RTC.cpp} (96%) create mode 100644 usermods/RTC/library.json rename usermods/SN_Photoresistor/{usermod_sn_photoresistor.h => SN_Photoresistor.cpp} (98%) create mode 100644 usermods/SN_Photoresistor/library.json rename usermods/ST7789_display/{ST7789_display.h => ST7789_display.cpp} (99%) create mode 100644 usermods/ST7789_display/library.json rename usermods/Si7021_MQTT_HA/{usermod_si7021_mqtt_ha.h => Si7021_MQTT_HA.cpp} (99%) create mode 100644 usermods/Si7021_MQTT_HA/library.json rename usermods/Temperature/{usermod_temperature.h => Temperature.cpp} (99%) create mode 100644 usermods/Temperature/library.json rename usermods/VL53L0X_gestures/{usermod_vl53l0x_gestures.h => VL53L0X_gestures.cpp} (98%) create mode 100644 usermods/VL53L0X_gestures/library.json rename usermods/boblight/{boblight.h => boblight.cpp} (99%) create mode 100644 usermods/boblight/library.json rename usermods/buzzer/{usermod_v2_buzzer.h => buzzer.cpp} (97%) create mode 100644 usermods/buzzer/library.json rename usermods/deep_sleep/{usermod_deep_sleep.h => deep_sleep.cpp} (98%) create mode 100644 usermods/deep_sleep/library.json create mode 100644 usermods/mpu6050_imu/library.json rename usermods/mpu6050_imu/{usermod_mpu6050_imu.h => mpu6050_imu.cpp} (99%) create mode 100644 usermods/multi_relay/library.json rename usermods/multi_relay/{usermod_multi_relay.h => multi_relay.cpp} (99%) create mode 100644 usermods/pixels_dice_tray/library.json rename usermods/pixels_dice_tray/{pixels_dice_tray.h => pixels_dice_tray.cpp} (99%) create mode 100644 usermods/pov_display/library.json rename usermods/pov_display/{usermod_pov_display.h => pov_display.cpp} (96%) create mode 100644 usermods/pwm_outputs/library.json rename usermods/pwm_outputs/{usermod_pwm_outputs.h => pwm_outputs.cpp} (98%) create mode 100644 usermods/quinled-an-penta/library.json rename usermods/quinled-an-penta/{quinled-an-penta.h => quinled-an-penta.cpp} (99%) create mode 100644 usermods/rgb-rotary-encoder/library.json rename usermods/rgb-rotary-encoder/{rgb-rotary-encoder.h => rgb-rotary-encoder.cpp} (99%) create mode 100644 usermods/sd_card/library.json rename usermods/sd_card/{usermod_sd_card.h => sd_card.cpp} (99%) create mode 100644 usermods/seven_segment_display/library.json rename usermods/seven_segment_display/{usermod_v2_seven_segment_display.h => seven_segment_display.cpp} (99%) create mode 100644 usermods/sht/library.json rename usermods/sht/{usermod_sht.h => sht.cpp} (99%) create mode 100644 usermods/smartnest/library.json rename usermods/smartnest/{usermod_smartnest.h => smartnest.cpp} (98%) create mode 100644 usermods/usermod_rotary_brightness_color/library.json rename usermods/usermod_rotary_brightness_color/{usermod_rotary_brightness_color.h => usermod_rotary_brightness_color.cpp} (98%) create mode 100644 usermods/usermod_v2_HttpPullLightControl/library.json create mode 100644 usermods/usermod_v2_four_line_display_ALT/library.json rename usermods/usermod_v2_four_line_display_ALT/{usermod_v2_four_line_display_ALT.h => usermod_v2_four_line_display_ALT.cpp} (99%) create mode 100644 usermods/usermod_v2_klipper_percentage/library.json rename usermods/usermod_v2_klipper_percentage/{usermod_v2_klipper_percentage.h => usermod_v2_klipper_percentage.cpp} (97%) create mode 100644 usermods/usermod_v2_ping_pong_clock/library.json rename usermods/usermod_v2_ping_pong_clock/{usermod_v2_ping_pong_clock.h => usermod_v2_ping_pong_clock.cpp} (97%) create mode 100644 usermods/usermod_v2_rotary_encoder_ui_ALT/library.json rename usermods/usermod_v2_rotary_encoder_ui_ALT/{usermod_v2_rotary_encoder_ui_ALT.h => usermod_v2_rotary_encoder_ui_ALT.cpp} (99%) create mode 100644 usermods/usermod_v2_word_clock/library.json rename usermods/usermod_v2_word_clock/{usermod_v2_word_clock.h => usermod_v2_word_clock.cpp} (99%) create mode 100644 usermods/wireguard/library.json rename usermods/wireguard/{wireguard.h => wireguard.cpp} (98%) create mode 100644 usermods/wizlights/library.json rename usermods/wizlights/{wizlights.h => wizlights.cpp} (98%) diff --git a/usermods/Analog_Clock/Analog_Clock.h b/usermods/Analog_Clock/Analog_Clock.cpp similarity index 99% rename from usermods/Analog_Clock/Analog_Clock.h rename to usermods/Analog_Clock/Analog_Clock.cpp index 9d82f767..8a4c048a 100644 --- a/usermods/Analog_Clock/Analog_Clock.h +++ b/usermods/Analog_Clock/Analog_Clock.cpp @@ -254,3 +254,7 @@ public: return USERMOD_ID_ANALOG_CLOCK; } }; + + +static AnalogClockUsermod analog_clock; +REGISTER_USERMOD(analog_clock); \ No newline at end of file diff --git a/usermods/Analog_Clock/library.json b/usermods/Analog_Clock/library.json new file mode 100644 index 00000000..ddba3a76 --- /dev/null +++ b/usermods/Analog_Clock/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Analog_Clock", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/Animated_Staircase/Animated_Staircase.h b/usermods/Animated_Staircase/Animated_Staircase.cpp similarity index 99% rename from usermods/Animated_Staircase/Animated_Staircase.h rename to usermods/Animated_Staircase/Animated_Staircase.cpp index 54a9b333..43d9db6b 100644 --- a/usermods/Animated_Staircase/Animated_Staircase.h +++ b/usermods/Animated_Staircase/Animated_Staircase.cpp @@ -562,3 +562,7 @@ const char Animated_Staircase::_bottomEcho_pin[] PROGMEM = "bottomEch const char Animated_Staircase::_topEchoCm[] PROGMEM = "top-dist-cm"; const char Animated_Staircase::_bottomEchoCm[] PROGMEM = "bottom-dist-cm"; const char Animated_Staircase::_togglePower[] PROGMEM = "toggle-on-off"; + + +static Animated_Staircase animated_staircase; +REGISTER_USERMOD(animated_staircase); \ No newline at end of file diff --git a/usermods/Animated_Staircase/library.json b/usermods/Animated_Staircase/library.json new file mode 100644 index 00000000..e37df311 --- /dev/null +++ b/usermods/Animated_Staircase/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Animated_Staircase", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/Battery/usermod_v2_Battery.h b/usermods/Battery/Battery.cpp similarity index 99% rename from usermods/Battery/usermod_v2_Battery.h rename to usermods/Battery/Battery.cpp index b36c5f4d..4646a238 100644 --- a/usermods/Battery/usermod_v2_Battery.h +++ b/usermods/Battery/Battery.cpp @@ -857,3 +857,7 @@ const char UsermodBattery::_preset[] PROGMEM = "preset"; const char UsermodBattery::_duration[] PROGMEM = "duration"; const char UsermodBattery::_init[] PROGMEM = "init"; const char UsermodBattery::_haDiscovery[] PROGMEM = "HA-discovery"; + + +static UsermodBattery battery; +REGISTER_USERMOD(battery); \ No newline at end of file diff --git a/usermods/Battery/library.json b/usermods/Battery/library.json new file mode 100644 index 00000000..bc0d97a1 --- /dev/null +++ b/usermods/Battery/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Battery", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/Cronixie/usermod_cronixie.h b/usermods/Cronixie/Cronixie.cpp similarity index 99% rename from usermods/Cronixie/usermod_cronixie.h rename to usermods/Cronixie/Cronixie.cpp index 671c5d13..09e7e25a 100644 --- a/usermods/Cronixie/usermod_cronixie.h +++ b/usermods/Cronixie/Cronixie.cpp @@ -299,4 +299,7 @@ class UsermodCronixie : public Usermod { { return USERMOD_ID_CRONIXIE; } -}; \ No newline at end of file +}; + +static UsermodCronixie cronixie; +REGISTER_USERMOD(cronixie); \ No newline at end of file diff --git a/usermods/Cronixie/library.json b/usermods/Cronixie/library.json new file mode 100644 index 00000000..f0d39d00 --- /dev/null +++ b/usermods/Cronixie/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Cronixie", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/DHT/usermod_dht.h b/usermods/DHT/DHT.cpp similarity index 99% rename from usermods/DHT/usermod_dht.h rename to usermods/DHT/DHT.cpp index 05a7267b..fad6dad5 100644 --- a/usermods/DHT/usermod_dht.h +++ b/usermods/DHT/DHT.cpp @@ -245,3 +245,7 @@ class UsermodDHT : public Usermod { } }; + + +static UsermodDHT dht; +REGISTER_USERMOD(dht); \ No newline at end of file diff --git a/usermods/DHT/library.json b/usermods/DHT/library.json new file mode 100644 index 00000000..bb677361 --- /dev/null +++ b/usermods/DHT/library.json @@ -0,0 +1,9 @@ +{ + "name:": "DHT", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/EleksTube_IPS/usermod_elekstube_ips.h b/usermods/EleksTube_IPS/EleksTube_IPS.cpp similarity index 98% rename from usermods/EleksTube_IPS/usermod_elekstube_ips.h rename to usermods/EleksTube_IPS/EleksTube_IPS.cpp index 0f7d92e7..48fbb2b4 100644 --- a/usermods/EleksTube_IPS/usermod_elekstube_ips.h +++ b/usermods/EleksTube_IPS/EleksTube_IPS.cpp @@ -156,3 +156,7 @@ class ElekstubeIPSUsermod : public Usermod { const char ElekstubeIPSUsermod::_name[] PROGMEM = "EleksTubeIPS"; const char ElekstubeIPSUsermod::_tubeSeg[] PROGMEM = "tubeSegment"; const char ElekstubeIPSUsermod::_digitOffset[] PROGMEM = "digitOffset"; + + +static ElekstubeIPSUsermod elekstube_ips; +REGISTER_USERMOD(elekstube_ips); \ No newline at end of file diff --git a/usermods/EleksTube_IPS/library.json b/usermods/EleksTube_IPS/library.json new file mode 100644 index 00000000..d025fc78 --- /dev/null +++ b/usermods/EleksTube_IPS/library.json @@ -0,0 +1,9 @@ +{ + "name:": "EleksTube_IPS", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/LDR_Dusk_Dawn_v2/usermod_LDR_Dusk_Dawn_v2.h b/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp similarity index 98% rename from usermods/LDR_Dusk_Dawn_v2/usermod_LDR_Dusk_Dawn_v2.h rename to usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp index 03f4c078..6104fcab 100644 --- a/usermods/LDR_Dusk_Dawn_v2/usermod_LDR_Dusk_Dawn_v2.h +++ b/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp @@ -151,3 +151,7 @@ class LDR_Dusk_Dawn_v2 : public Usermod { }; const char LDR_Dusk_Dawn_v2::_name[] PROGMEM = "LDR_Dusk_Dawn_v2"; + + +static LDR_Dusk_Dawn_v2 ldr_dusk_dawn_v2; +REGISTER_USERMOD(ldr_dusk_dawn_v2); \ No newline at end of file diff --git a/usermods/LDR_Dusk_Dawn_v2/library.json b/usermods/LDR_Dusk_Dawn_v2/library.json new file mode 100644 index 00000000..6a08c9cc --- /dev/null +++ b/usermods/LDR_Dusk_Dawn_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "LDR_Dusk_Dawn_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h b/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp similarity index 96% rename from usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h rename to usermods/PIR_sensor_switch/PIR_sensor_switch.cpp index 0deda181..1cc31a08 100644 --- a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h +++ b/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp @@ -571,3 +571,7 @@ bool PIRsensorSwitch::readFromConfig(JsonObject &root) // use "return !top["newestParameter"].isNull();" when updating Usermod with new features return !(pins.isNull() || pins.size() != PIR_SENSOR_MAX_SENSORS); } + + +static PIRsensorSwitch pir_sensor_switch; +REGISTER_USERMOD(pir_sensor_switch); \ No newline at end of file diff --git a/usermods/PIR_sensor_switch/library.json b/usermods/PIR_sensor_switch/library.json new file mode 100644 index 00000000..152946e4 --- /dev/null +++ b/usermods/PIR_sensor_switch/library.json @@ -0,0 +1,9 @@ +{ + "name:": "PIR_sensor_switch", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/PWM_fan/usermod_PWM_fan.h b/usermods/PWM_fan/PWM_fan.cpp similarity index 99% rename from usermods/PWM_fan/usermod_PWM_fan.h rename to usermods/PWM_fan/PWM_fan.cpp index c3ef24fe..9df37304 100644 --- a/usermods/PWM_fan/usermod_PWM_fan.h +++ b/usermods/PWM_fan/PWM_fan.cpp @@ -397,3 +397,7 @@ const char PWMFanUsermod::_maxPWMValuePct[] PROGMEM = "max-PWM-percent"; const char PWMFanUsermod::_IRQperRotation[] PROGMEM = "IRQs-per-rotation"; const char PWMFanUsermod::_speed[] PROGMEM = "speed"; const char PWMFanUsermod::_lock[] PROGMEM = "lock"; + + +static PWMFanUsermod pwm_fan; +REGISTER_USERMOD(pwm_fan); \ No newline at end of file diff --git a/usermods/PWM_fan/library.json b/usermods/PWM_fan/library.json new file mode 100644 index 00000000..a6d5ea64 --- /dev/null +++ b/usermods/PWM_fan/library.json @@ -0,0 +1,9 @@ +{ + "name:": "PWM_fan", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/RTC/usermod_rtc.h b/usermods/RTC/RTC.cpp similarity index 96% rename from usermods/RTC/usermod_rtc.h rename to usermods/RTC/RTC.cpp index 42965e3a..f9dbe3cf 100644 --- a/usermods/RTC/usermod_rtc.h +++ b/usermods/RTC/RTC.cpp @@ -48,4 +48,7 @@ class RTCUsermod : public Usermod { { return USERMOD_ID_RTC; } -}; \ No newline at end of file +}; + +static RTCUsermod rtc; +REGISTER_USERMOD(rtc); \ No newline at end of file diff --git a/usermods/RTC/library.json b/usermods/RTC/library.json new file mode 100644 index 00000000..96aa095b --- /dev/null +++ b/usermods/RTC/library.json @@ -0,0 +1,9 @@ +{ + "name:": "RTC", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/SN_Photoresistor/usermod_sn_photoresistor.h b/usermods/SN_Photoresistor/SN_Photoresistor.cpp similarity index 98% rename from usermods/SN_Photoresistor/usermod_sn_photoresistor.h rename to usermods/SN_Photoresistor/SN_Photoresistor.cpp index 45cdb66a..5e50ab7a 100644 --- a/usermods/SN_Photoresistor/usermod_sn_photoresistor.h +++ b/usermods/SN_Photoresistor/SN_Photoresistor.cpp @@ -210,3 +210,7 @@ const char Usermod_SN_Photoresistor::_referenceVoltage[] PROGMEM = "supplied-vol const char Usermod_SN_Photoresistor::_resistorValue[] PROGMEM = "resistor-value"; const char Usermod_SN_Photoresistor::_adcPrecision[] PROGMEM = "adc-precision"; const char Usermod_SN_Photoresistor::_offset[] PROGMEM = "offset"; + + +static Usermod_SN_Photoresistor sn_photoresistor; +REGISTER_USERMOD(sn_photoresistor); \ No newline at end of file diff --git a/usermods/SN_Photoresistor/library.json b/usermods/SN_Photoresistor/library.json new file mode 100644 index 00000000..fe5173be --- /dev/null +++ b/usermods/SN_Photoresistor/library.json @@ -0,0 +1,9 @@ +{ + "name:": "SN_Photoresistor", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/ST7789_display/ST7789_display.h b/usermods/ST7789_display/ST7789_display.cpp similarity index 99% rename from usermods/ST7789_display/ST7789_display.h rename to usermods/ST7789_display/ST7789_display.cpp index 65f4cae5..e81c53ba 100644 --- a/usermods/ST7789_display/ST7789_display.h +++ b/usermods/ST7789_display/ST7789_display.cpp @@ -410,4 +410,7 @@ class St7789DisplayUsermod : public Usermod { //More methods can be added in the future, this example will then be extended. //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class! -}; \ No newline at end of file +}; + +static name. st7789_display; +REGISTER_USERMOD(st7789_display); \ No newline at end of file diff --git a/usermods/ST7789_display/library.json b/usermods/ST7789_display/library.json new file mode 100644 index 00000000..88f4efe7 --- /dev/null +++ b/usermods/ST7789_display/library.json @@ -0,0 +1,9 @@ +{ + "name:": "ST7789_display", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/Si7021_MQTT_HA/usermod_si7021_mqtt_ha.h b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp similarity index 99% rename from usermods/Si7021_MQTT_HA/usermod_si7021_mqtt_ha.h rename to usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp index 9f027382..04f6d750 100644 --- a/usermods/Si7021_MQTT_HA/usermod_si7021_mqtt_ha.h +++ b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp @@ -229,3 +229,7 @@ const char Si7021_MQTT_HA::_name[] PROGMEM = "Si7021 MQTT (Hom const char Si7021_MQTT_HA::_enabled[] PROGMEM = "enabled"; const char Si7021_MQTT_HA::_sendAdditionalSensors[] PROGMEM = "Send Dew Point, Abs. Humidity and Heat Index"; const char Si7021_MQTT_HA::_haAutoDiscovery[] PROGMEM = "Home Assistant MQTT Auto-Discovery"; + + +static Si7021_MQTT_HA si7021_mqtt_ha; +REGISTER_USERMOD(si7021_mqtt_ha); \ No newline at end of file diff --git a/usermods/Si7021_MQTT_HA/library.json b/usermods/Si7021_MQTT_HA/library.json new file mode 100644 index 00000000..2c18375f --- /dev/null +++ b/usermods/Si7021_MQTT_HA/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Si7021_MQTT_HA", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/Temperature.cpp similarity index 99% rename from usermods/Temperature/usermod_temperature.h rename to usermods/Temperature/Temperature.cpp index 178bc05a..a17bd2d9 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/Temperature.cpp @@ -471,3 +471,7 @@ static uint16_t mode_temperature() { SEGMENT.fill(SEGMENT.color_from_palette(i, false, false, 255)); return FRAMETIME; } + + +static UsermodTemperature temperature; +REGISTER_USERMOD(temperature); \ No newline at end of file diff --git a/usermods/Temperature/library.json b/usermods/Temperature/library.json new file mode 100644 index 00000000..56371db4 --- /dev/null +++ b/usermods/Temperature/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Temperature", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/VL53L0X_gestures/usermod_vl53l0x_gestures.h b/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp similarity index 98% rename from usermods/VL53L0X_gestures/usermod_vl53l0x_gestures.h rename to usermods/VL53L0X_gestures/VL53L0X_gestures.cpp index fe6b958f..759c31c7 100644 --- a/usermods/VL53L0X_gestures/usermod_vl53l0x_gestures.h +++ b/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp @@ -126,4 +126,7 @@ class UsermodVL53L0XGestures : public Usermod { { return USERMOD_ID_VL53L0X; } -}; \ No newline at end of file +}; + +static UsermodVL53L0XGestures vl53l0x_gestures; +REGISTER_USERMOD(vl53l0x_gestures); \ No newline at end of file diff --git a/usermods/VL53L0X_gestures/library.json b/usermods/VL53L0X_gestures/library.json new file mode 100644 index 00000000..77521d6f --- /dev/null +++ b/usermods/VL53L0X_gestures/library.json @@ -0,0 +1,9 @@ +{ + "name:": "VL53L0X_gestures", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/boblight/boblight.h b/usermods/boblight/boblight.cpp similarity index 99% rename from usermods/boblight/boblight.h rename to usermods/boblight/boblight.cpp index b04b78fa..2a52fc15 100644 --- a/usermods/boblight/boblight.h +++ b/usermods/boblight/boblight.cpp @@ -457,3 +457,7 @@ void BobLightUsermod::pollBob() { } } } + + +static BobLightUsermod boblight; +REGISTER_USERMOD(boblight); \ No newline at end of file diff --git a/usermods/boblight/library.json b/usermods/boblight/library.json new file mode 100644 index 00000000..0b63b224 --- /dev/null +++ b/usermods/boblight/library.json @@ -0,0 +1,9 @@ +{ + "name:": "boblight", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/buzzer/usermod_v2_buzzer.h b/usermods/buzzer/buzzer.cpp similarity index 97% rename from usermods/buzzer/usermod_v2_buzzer.h rename to usermods/buzzer/buzzer.cpp index ebd8dcb1..e421a239 100644 --- a/usermods/buzzer/usermod_v2_buzzer.h +++ b/usermods/buzzer/buzzer.cpp @@ -78,4 +78,7 @@ class BuzzerUsermod : public Usermod { { return USERMOD_ID_BUZZER; } -}; \ No newline at end of file +}; + +static BuzzerUsermod buzzer; +REGISTER_USERMOD(buzzer); \ No newline at end of file diff --git a/usermods/buzzer/library.json b/usermods/buzzer/library.json new file mode 100644 index 00000000..78ba4152 --- /dev/null +++ b/usermods/buzzer/library.json @@ -0,0 +1,9 @@ +{ + "name:": "buzzer", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/deep_sleep/usermod_deep_sleep.h b/usermods/deep_sleep/deep_sleep.cpp similarity index 98% rename from usermods/deep_sleep/usermod_deep_sleep.h rename to usermods/deep_sleep/deep_sleep.cpp index 7f4efd5c..741b618f 100644 --- a/usermods/deep_sleep/usermod_deep_sleep.h +++ b/usermods/deep_sleep/deep_sleep.cpp @@ -224,4 +224,7 @@ void addToConfig(JsonObject& root) override // add more strings here to reduce flash memory usage const char DeepSleepUsermod::_name[] PROGMEM = "DeepSleep"; -const char DeepSleepUsermod::_enabled[] PROGMEM = "enabled"; \ No newline at end of file +const char DeepSleepUsermod::_enabled[] PROGMEM = "enabled"; + +static DeepSleepUsermod deep_sleep; +REGISTER_USERMOD(deep_sleep); \ No newline at end of file diff --git a/usermods/deep_sleep/library.json b/usermods/deep_sleep/library.json new file mode 100644 index 00000000..c15e8d57 --- /dev/null +++ b/usermods/deep_sleep/library.json @@ -0,0 +1,9 @@ +{ + "name:": "deep_sleep", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/mpu6050_imu/library.json b/usermods/mpu6050_imu/library.json new file mode 100644 index 00000000..bf86aed6 --- /dev/null +++ b/usermods/mpu6050_imu/library.json @@ -0,0 +1,9 @@ +{ + "name:": "mpu6050_imu", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/mpu6050_imu/usermod_mpu6050_imu.h b/usermods/mpu6050_imu/mpu6050_imu.cpp similarity index 99% rename from usermods/mpu6050_imu/usermod_mpu6050_imu.h rename to usermods/mpu6050_imu/mpu6050_imu.cpp index f04578fe..2f8166cd 100644 --- a/usermods/mpu6050_imu/usermod_mpu6050_imu.h +++ b/usermods/mpu6050_imu/mpu6050_imu.cpp @@ -446,3 +446,7 @@ const char MPU6050Driver::_z_acc_bias[] PROGMEM = "z_acc_bias"; const char MPU6050Driver::_x_gyro_bias[] PROGMEM = "x_gyro_bias"; const char MPU6050Driver::_y_gyro_bias[] PROGMEM = "y_gyro_bias"; const char MPU6050Driver::_z_gyro_bias[] PROGMEM = "z_gyro_bias"; + + +static MPU6050Driver mpu6050_imu; +REGISTER_USERMOD(mpu6050_imu); \ No newline at end of file diff --git a/usermods/multi_relay/library.json b/usermods/multi_relay/library.json new file mode 100644 index 00000000..47505d0b --- /dev/null +++ b/usermods/multi_relay/library.json @@ -0,0 +1,9 @@ +{ + "name:": "multi_relay", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/multi_relay/usermod_multi_relay.h b/usermods/multi_relay/multi_relay.cpp similarity index 99% rename from usermods/multi_relay/usermod_multi_relay.h rename to usermods/multi_relay/multi_relay.cpp index c4446c7a..ea07e281 100644 --- a/usermods/multi_relay/usermod_multi_relay.h +++ b/usermods/multi_relay/multi_relay.cpp @@ -842,3 +842,7 @@ const char MultiRelay::_pcfAddress[] PROGMEM = "PCF8574-address"; const char MultiRelay::_switch[] PROGMEM = "switch"; const char MultiRelay::_toggle[] PROGMEM = "toggle"; const char MultiRelay::_Command[] PROGMEM = "/command"; + + +static MultiRelay multi_relay; +REGISTER_USERMOD(multi_relay); \ No newline at end of file diff --git a/usermods/pixels_dice_tray/library.json b/usermods/pixels_dice_tray/library.json new file mode 100644 index 00000000..01776ffe --- /dev/null +++ b/usermods/pixels_dice_tray/library.json @@ -0,0 +1,9 @@ +{ + "name:": "pixels_dice_tray", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/pixels_dice_tray/pixels_dice_tray.h b/usermods/pixels_dice_tray/pixels_dice_tray.cpp similarity index 99% rename from usermods/pixels_dice_tray/pixels_dice_tray.h rename to usermods/pixels_dice_tray/pixels_dice_tray.cpp index 61348ebb..07fd3d59 100644 --- a/usermods/pixels_dice_tray/pixels_dice_tray.h +++ b/usermods/pixels_dice_tray/pixels_dice_tray.cpp @@ -533,3 +533,7 @@ class PixelsDiceTrayUsermod : public Usermod { // extended. Your usermod will remain compatible as it does not need to // implement all methods from the Usermod base class! }; + + +static PixelsDiceTrayUsermod pixels_dice_tray; +REGISTER_USERMOD(pixels_dice_tray); \ No newline at end of file diff --git a/usermods/pov_display/library.json b/usermods/pov_display/library.json new file mode 100644 index 00000000..5998377b --- /dev/null +++ b/usermods/pov_display/library.json @@ -0,0 +1,9 @@ +{ + "name:": "pov_display", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/pov_display/usermod_pov_display.h b/usermods/pov_display/pov_display.cpp similarity index 96% rename from usermods/pov_display/usermod_pov_display.h rename to usermods/pov_display/pov_display.cpp index b1fc0dba..c1bd143a 100644 --- a/usermods/pov_display/usermod_pov_display.h +++ b/usermods/pov_display/pov_display.cpp @@ -83,3 +83,7 @@ class PovDisplayUsermod : public Usermod void connected() {} }; + + +static PovDisplayUsermod pov_display; +REGISTER_USERMOD(pov_display); \ No newline at end of file diff --git a/usermods/pwm_outputs/library.json b/usermods/pwm_outputs/library.json new file mode 100644 index 00000000..18ce7d88 --- /dev/null +++ b/usermods/pwm_outputs/library.json @@ -0,0 +1,9 @@ +{ + "name:": "pwm_outputs", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/pwm_outputs/usermod_pwm_outputs.h b/usermods/pwm_outputs/pwm_outputs.cpp similarity index 98% rename from usermods/pwm_outputs/usermod_pwm_outputs.h rename to usermods/pwm_outputs/pwm_outputs.cpp index 09232f04..72a78475 100644 --- a/usermods/pwm_outputs/usermod_pwm_outputs.h +++ b/usermods/pwm_outputs/pwm_outputs.cpp @@ -219,3 +219,7 @@ class PwmOutputsUsermod : public Usermod { const char PwmOutputsUsermod::USERMOD_NAME[] PROGMEM = "PwmOutputs"; const char PwmOutputsUsermod::PWM_STATE_NAME[] PROGMEM = "pwm"; + + +static PwmOutputsUsermod pwm_outputs; +REGISTER_USERMOD(pwm_outputs); \ No newline at end of file diff --git a/usermods/quinled-an-penta/library.json b/usermods/quinled-an-penta/library.json new file mode 100644 index 00000000..274020d9 --- /dev/null +++ b/usermods/quinled-an-penta/library.json @@ -0,0 +1,9 @@ +{ + "name:": "quinled-an-penta", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/quinled-an-penta/quinled-an-penta.h b/usermods/quinled-an-penta/quinled-an-penta.cpp similarity index 99% rename from usermods/quinled-an-penta/quinled-an-penta.h rename to usermods/quinled-an-penta/quinled-an-penta.cpp index e4467203..612ade03 100644 --- a/usermods/quinled-an-penta/quinled-an-penta.h +++ b/usermods/quinled-an-penta/quinled-an-penta.cpp @@ -752,4 +752,7 @@ const unsigned char QuinLEDAnPentaUsermod::quinLedLogo[] PROGMEM = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; \ No newline at end of file +}; + +static QuinLEDAnPentaUsermod quinled-an-penta; +REGISTER_USERMOD(quinled-an-penta); \ No newline at end of file diff --git a/usermods/rgb-rotary-encoder/library.json b/usermods/rgb-rotary-encoder/library.json new file mode 100644 index 00000000..c23606c0 --- /dev/null +++ b/usermods/rgb-rotary-encoder/library.json @@ -0,0 +1,9 @@ +{ + "name:": "rgb-rotary-encoder", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.h b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp similarity index 99% rename from usermods/rgb-rotary-encoder/rgb-rotary-encoder.h rename to usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp index 00fc2272..3e7b96bb 100644 --- a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.h +++ b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp @@ -340,4 +340,7 @@ const char RgbRotaryEncoderUsermod::_ebIo[] PROGMEM = "eb-pin"; const char RgbRotaryEncoderUsermod::_ledMode[] PROGMEM = "LED-Mode"; const char RgbRotaryEncoderUsermod::_ledBrightness[] PROGMEM = "LED-Brightness"; const char RgbRotaryEncoderUsermod::_stepsPerClick[] PROGMEM = "Steps-per-Click"; -const char RgbRotaryEncoderUsermod::_incrementPerClick[] PROGMEM = "Increment-per-Click"; \ No newline at end of file +const char RgbRotaryEncoderUsermod::_incrementPerClick[] PROGMEM = "Increment-per-Click"; + +static RgbRotaryEncoderUsermod rgb-rotary-encoder; +REGISTER_USERMOD(rgb-rotary-encoder); \ No newline at end of file diff --git a/usermods/sd_card/library.json b/usermods/sd_card/library.json new file mode 100644 index 00000000..777c6264 --- /dev/null +++ b/usermods/sd_card/library.json @@ -0,0 +1,9 @@ +{ + "name:": "sd_card", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/sd_card/usermod_sd_card.h b/usermods/sd_card/sd_card.cpp similarity index 99% rename from usermods/sd_card/usermod_sd_card.h rename to usermods/sd_card/sd_card.cpp index da1999d9..e33a643f 100644 --- a/usermods/sd_card/usermod_sd_card.h +++ b/usermods/sd_card/sd_card.cpp @@ -240,4 +240,7 @@ void listDir( const char * dirname, uint8_t levels){ } } -#endif \ No newline at end of file +#endif + +static UsermodSdCard sd_card; +REGISTER_USERMOD(sd_card); \ No newline at end of file diff --git a/usermods/seven_segment_display/library.json b/usermods/seven_segment_display/library.json new file mode 100644 index 00000000..c10bd084 --- /dev/null +++ b/usermods/seven_segment_display/library.json @@ -0,0 +1,9 @@ +{ + "name:": "seven_segment_display", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/seven_segment_display/usermod_v2_seven_segment_display.h b/usermods/seven_segment_display/seven_segment_display.cpp similarity index 99% rename from usermods/seven_segment_display/usermod_v2_seven_segment_display.h rename to usermods/seven_segment_display/seven_segment_display.cpp index 20fef15d..d3aa5737 100644 --- a/usermods/seven_segment_display/usermod_v2_seven_segment_display.h +++ b/usermods/seven_segment_display/seven_segment_display.cpp @@ -498,4 +498,7 @@ const char SevenSegmentDisplay::_str_timeEnabled[] PROGMEM = "timeEnabled"; const char SevenSegmentDisplay::_str_scrollSpd[] PROGMEM = "scrollSpd"; const char SevenSegmentDisplay::_str_displayMask[] PROGMEM = "displayMask"; const char SevenSegmentDisplay::_str_displayMsg[] PROGMEM = "displayMsg"; -const char SevenSegmentDisplay::_str_sevenSeg[] PROGMEM = "sevenSeg"; \ No newline at end of file +const char SevenSegmentDisplay::_str_sevenSeg[] PROGMEM = "sevenSeg"; + +static SevenSegmentDisplay seven_segment_display; +REGISTER_USERMOD(seven_segment_display); \ No newline at end of file diff --git a/usermods/sht/library.json b/usermods/sht/library.json new file mode 100644 index 00000000..2cb0003a --- /dev/null +++ b/usermods/sht/library.json @@ -0,0 +1,9 @@ +{ + "name:": "sht", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/sht/usermod_sht.h b/usermods/sht/sht.cpp similarity index 99% rename from usermods/sht/usermod_sht.h rename to usermods/sht/sht.cpp index f10c78a2..7641bbc2 100644 --- a/usermods/sht/usermod_sht.h +++ b/usermods/sht/sht.cpp @@ -477,4 +477,7 @@ float ShtUsermod::getTemperature() { */ const char* ShtUsermod::getUnitString() { return unitOfTemp ? "°F" : "°C"; -} \ No newline at end of file +} + +static ShtUsermod sht; +REGISTER_USERMOD(sht); \ No newline at end of file diff --git a/usermods/smartnest/library.json b/usermods/smartnest/library.json new file mode 100644 index 00000000..4e776ad7 --- /dev/null +++ b/usermods/smartnest/library.json @@ -0,0 +1,9 @@ +{ + "name:": "smartnest", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/smartnest/usermod_smartnest.h b/usermods/smartnest/smartnest.cpp similarity index 98% rename from usermods/smartnest/usermod_smartnest.h rename to usermods/smartnest/smartnest.cpp index 9d21ef2e..be7710ab 100644 --- a/usermods/smartnest/usermod_smartnest.h +++ b/usermods/smartnest/smartnest.cpp @@ -203,3 +203,7 @@ public: } } }; + + +static Smartnest smartnest; +REGISTER_USERMOD(smartnest); \ No newline at end of file diff --git a/usermods/usermod_rotary_brightness_color/library.json b/usermods/usermod_rotary_brightness_color/library.json new file mode 100644 index 00000000..8d368082 --- /dev/null +++ b/usermods/usermod_rotary_brightness_color/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_rotary_brightness_color", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.h b/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp similarity index 98% rename from usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.h rename to usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp index 85a9a160..076e91f7 100644 --- a/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.h +++ b/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp @@ -187,3 +187,7 @@ public: return configComplete; } }; + + +static RotaryEncoderBrightnessColor usermod_rotary_brightness_color; +REGISTER_USERMOD(usermod_rotary_brightness_color); \ No newline at end of file diff --git a/usermods/usermod_v2_HttpPullLightControl/library.json b/usermods/usermod_v2_HttpPullLightControl/library.json new file mode 100644 index 00000000..68b93708 --- /dev/null +++ b/usermods/usermod_v2_HttpPullLightControl/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_v2_HttpPullLightControl", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_four_line_display_ALT/library.json b/usermods/usermod_v2_four_line_display_ALT/library.json new file mode 100644 index 00000000..6dccb4a9 --- /dev/null +++ b/usermods/usermod_v2_four_line_display_ALT/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_v2_four_line_display_ALT", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp similarity index 99% rename from usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h rename to usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp index 684dd86e..851e378e 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp @@ -1386,3 +1386,7 @@ bool FourLineDisplayUsermod::readFromConfig(JsonObject& root) { // use "return !top["newestParameter"].isNull();" when updating Usermod with new features return !top[FPSTR(_contrastFix)].isNull(); } + + +static FourLineDisplayUsermod usermod_v2_four_line_display_alt; +REGISTER_USERMOD(usermod_v2_four_line_display_alt); \ No newline at end of file diff --git a/usermods/usermod_v2_klipper_percentage/library.json b/usermods/usermod_v2_klipper_percentage/library.json new file mode 100644 index 00000000..afd96163 --- /dev/null +++ b/usermods/usermod_v2_klipper_percentage/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_v2_klipper_percentage", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.h b/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp similarity index 97% rename from usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.h rename to usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp index bd4170dd..55132b84 100644 --- a/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.h +++ b/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp @@ -219,4 +219,7 @@ public: } }; const char klipper_percentage::_name[] PROGMEM = "Klipper_Percentage"; -const char klipper_percentage::_enabled[] PROGMEM = "enabled"; \ No newline at end of file +const char klipper_percentage::_enabled[] PROGMEM = "enabled"; + +static klipper_percentage usermod_v2_klipper_percentage; +REGISTER_USERMOD(usermod_v2_klipper_percentage); \ No newline at end of file diff --git a/usermods/usermod_v2_ping_pong_clock/library.json b/usermods/usermod_v2_ping_pong_clock/library.json new file mode 100644 index 00000000..19708611 --- /dev/null +++ b/usermods/usermod_v2_ping_pong_clock/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_v2_ping_pong_clock", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.h b/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp similarity index 97% rename from usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.h rename to usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp index 40ff675c..8212947a 100644 --- a/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.h +++ b/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp @@ -117,3 +117,7 @@ public: } }; + + +static PingPongClockUsermod usermod_v2_ping_pong_clock; +REGISTER_USERMOD(usermod_v2_ping_pong_clock); \ No newline at end of file diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json new file mode 100644 index 00000000..f7c60ecd --- /dev/null +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_v2_rotary_encoder_ui_ALT", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp similarity index 99% rename from usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h rename to usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp index 383c1193..ac2cc3c4 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp @@ -1175,3 +1175,7 @@ const char RotaryEncoderUIUsermod::_applyToAll[] PROGMEM = "apply-2-all-seg"; const char RotaryEncoderUIUsermod::_pcf8574[] PROGMEM = "use-PCF8574"; const char RotaryEncoderUIUsermod::_pcfAddress[] PROGMEM = "PCF8574-address"; const char RotaryEncoderUIUsermod::_pcfINTpin[] PROGMEM = "PCF8574-INT-pin"; + + +static RotaryEncoderUIUsermod usermod_v2_rotary_encoder_ui_alt; +REGISTER_USERMOD(usermod_v2_rotary_encoder_ui_alt); \ No newline at end of file diff --git a/usermods/usermod_v2_word_clock/library.json b/usermods/usermod_v2_word_clock/library.json new file mode 100644 index 00000000..74a3d903 --- /dev/null +++ b/usermods/usermod_v2_word_clock/library.json @@ -0,0 +1,9 @@ +{ + "name:": "usermod_v2_word_clock", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_word_clock/usermod_v2_word_clock.h b/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp similarity index 99% rename from usermods/usermod_v2_word_clock/usermod_v2_word_clock.h rename to usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp index 7ecec08e..781dd7d8 100644 --- a/usermods/usermod_v2_word_clock/usermod_v2_word_clock.h +++ b/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp @@ -504,4 +504,7 @@ class WordClockUsermod : public Usermod //More methods can be added in the future, this example will then be extended. //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class! -}; \ No newline at end of file +}; + +static WordClockUsermod usermod_v2_word_clock; +REGISTER_USERMOD(usermod_v2_word_clock); \ No newline at end of file diff --git a/usermods/wireguard/library.json b/usermods/wireguard/library.json new file mode 100644 index 00000000..290f2794 --- /dev/null +++ b/usermods/wireguard/library.json @@ -0,0 +1,9 @@ +{ + "name:": "wireguard", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/wireguard/wireguard.h b/usermods/wireguard/wireguard.cpp similarity index 98% rename from usermods/wireguard/wireguard.h rename to usermods/wireguard/wireguard.cpp index 8656a704..77cc952f 100644 --- a/usermods/wireguard/wireguard.h +++ b/usermods/wireguard/wireguard.cpp @@ -124,4 +124,7 @@ class WireguardUsermod : public Usermod { int endpoint_port = 0; bool is_enabled = false; unsigned long lastTime = 0; -}; \ No newline at end of file +}; + +static WireguardUsermod wireguard; +REGISTER_USERMOD(wireguard); \ No newline at end of file diff --git a/usermods/wizlights/library.json b/usermods/wizlights/library.json new file mode 100644 index 00000000..a82dd7fc --- /dev/null +++ b/usermods/wizlights/library.json @@ -0,0 +1,9 @@ +{ + "name:": "wizlights", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/wizlights/wizlights.h b/usermods/wizlights/wizlights.cpp similarity index 98% rename from usermods/wizlights/wizlights.h rename to usermods/wizlights/wizlights.cpp index 08d20493..67c0effd 100644 --- a/usermods/wizlights/wizlights.h +++ b/usermods/wizlights/wizlights.cpp @@ -156,3 +156,7 @@ class WizLightsUsermod : public Usermod { uint16_t getId(){return USERMOD_ID_WIZLIGHTS;} }; + + +static WizLightsUsermod wizlights; +REGISTER_USERMOD(wizlights); \ No newline at end of file From a5575bc3a037b50f0f4be6be8ad1c28f0b5e1ca7 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 21:41:21 +0000 Subject: [PATCH 05/64] Fix naming of usermod files to match library name --- usermods/ADS1115_v2/{usermod_ads1115.h => ADS1115_v2.h} | 0 usermods/AHT10_v2/{usermod_aht10.h => AHT10_v2.h} | 0 usermods/BH1750_v2/{usermod_bh1750.h => BH1750_v2.h} | 0 usermods/BME280_v2/{usermod_bme280.h => BME280_v2.h} | 0 usermods/BME68X_v2/{usermod_bme68x.h => BME68X_v2.h} | 0 usermods/INA226_v2/{usermod_ina226.h => INA226_v2.h} | 0 .../{usermod_internal_temperature.h => Internal_Temperature_v2.h} | 0 usermods/LD2410_v2/{usermod_ld2410.h => LD2410_v2.h} | 0 usermods/MAX17048_v2/{usermod_max17048.h => MAX17048_v2.h} | 0 usermods/MY9291/{usermode_MY9291.h => MY9291.h} | 0 usermods/TetrisAI_v2/{usermod_v2_tetrisai.h => TetrisAI_v2.h} | 0 .../mqtt_switch_v2/{usermod_mqtt_switch.h => mqtt_switch_v2.h} | 0 .../{usermod_v2_SensorsToMqtt.h => sensors_to_mqtt.h} | 0 ..._seven_segment_reloaded.h => seven_segment_display_reloaded.h} | 0 .../{stairway-wipe-usermod-v2.h => stairway_wipe_basic.h} | 0 .../{usermod_word_clock_matrix.h => word-clock-matrix.h} | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename usermods/ADS1115_v2/{usermod_ads1115.h => ADS1115_v2.h} (100%) rename usermods/AHT10_v2/{usermod_aht10.h => AHT10_v2.h} (100%) rename usermods/BH1750_v2/{usermod_bh1750.h => BH1750_v2.h} (100%) rename usermods/BME280_v2/{usermod_bme280.h => BME280_v2.h} (100%) rename usermods/BME68X_v2/{usermod_bme68x.h => BME68X_v2.h} (100%) rename usermods/INA226_v2/{usermod_ina226.h => INA226_v2.h} (100%) rename usermods/Internal_Temperature_v2/{usermod_internal_temperature.h => Internal_Temperature_v2.h} (100%) rename usermods/LD2410_v2/{usermod_ld2410.h => LD2410_v2.h} (100%) rename usermods/MAX17048_v2/{usermod_max17048.h => MAX17048_v2.h} (100%) rename usermods/MY9291/{usermode_MY9291.h => MY9291.h} (100%) rename usermods/TetrisAI_v2/{usermod_v2_tetrisai.h => TetrisAI_v2.h} (100%) rename usermods/mqtt_switch_v2/{usermod_mqtt_switch.h => mqtt_switch_v2.h} (100%) rename usermods/sensors_to_mqtt/{usermod_v2_SensorsToMqtt.h => sensors_to_mqtt.h} (100%) rename usermods/seven_segment_display_reloaded/{usermod_seven_segment_reloaded.h => seven_segment_display_reloaded.h} (100%) rename usermods/stairway_wipe_basic/{stairway-wipe-usermod-v2.h => stairway_wipe_basic.h} (100%) rename usermods/word-clock-matrix/{usermod_word_clock_matrix.h => word-clock-matrix.h} (100%) diff --git a/usermods/ADS1115_v2/usermod_ads1115.h b/usermods/ADS1115_v2/ADS1115_v2.h similarity index 100% rename from usermods/ADS1115_v2/usermod_ads1115.h rename to usermods/ADS1115_v2/ADS1115_v2.h diff --git a/usermods/AHT10_v2/usermod_aht10.h b/usermods/AHT10_v2/AHT10_v2.h similarity index 100% rename from usermods/AHT10_v2/usermod_aht10.h rename to usermods/AHT10_v2/AHT10_v2.h diff --git a/usermods/BH1750_v2/usermod_bh1750.h b/usermods/BH1750_v2/BH1750_v2.h similarity index 100% rename from usermods/BH1750_v2/usermod_bh1750.h rename to usermods/BH1750_v2/BH1750_v2.h diff --git a/usermods/BME280_v2/usermod_bme280.h b/usermods/BME280_v2/BME280_v2.h similarity index 100% rename from usermods/BME280_v2/usermod_bme280.h rename to usermods/BME280_v2/BME280_v2.h diff --git a/usermods/BME68X_v2/usermod_bme68x.h b/usermods/BME68X_v2/BME68X_v2.h similarity index 100% rename from usermods/BME68X_v2/usermod_bme68x.h rename to usermods/BME68X_v2/BME68X_v2.h diff --git a/usermods/INA226_v2/usermod_ina226.h b/usermods/INA226_v2/INA226_v2.h similarity index 100% rename from usermods/INA226_v2/usermod_ina226.h rename to usermods/INA226_v2/INA226_v2.h diff --git a/usermods/Internal_Temperature_v2/usermod_internal_temperature.h b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.h similarity index 100% rename from usermods/Internal_Temperature_v2/usermod_internal_temperature.h rename to usermods/Internal_Temperature_v2/Internal_Temperature_v2.h diff --git a/usermods/LD2410_v2/usermod_ld2410.h b/usermods/LD2410_v2/LD2410_v2.h similarity index 100% rename from usermods/LD2410_v2/usermod_ld2410.h rename to usermods/LD2410_v2/LD2410_v2.h diff --git a/usermods/MAX17048_v2/usermod_max17048.h b/usermods/MAX17048_v2/MAX17048_v2.h similarity index 100% rename from usermods/MAX17048_v2/usermod_max17048.h rename to usermods/MAX17048_v2/MAX17048_v2.h diff --git a/usermods/MY9291/usermode_MY9291.h b/usermods/MY9291/MY9291.h similarity index 100% rename from usermods/MY9291/usermode_MY9291.h rename to usermods/MY9291/MY9291.h diff --git a/usermods/TetrisAI_v2/usermod_v2_tetrisai.h b/usermods/TetrisAI_v2/TetrisAI_v2.h similarity index 100% rename from usermods/TetrisAI_v2/usermod_v2_tetrisai.h rename to usermods/TetrisAI_v2/TetrisAI_v2.h diff --git a/usermods/mqtt_switch_v2/usermod_mqtt_switch.h b/usermods/mqtt_switch_v2/mqtt_switch_v2.h similarity index 100% rename from usermods/mqtt_switch_v2/usermod_mqtt_switch.h rename to usermods/mqtt_switch_v2/mqtt_switch_v2.h diff --git a/usermods/sensors_to_mqtt/usermod_v2_SensorsToMqtt.h b/usermods/sensors_to_mqtt/sensors_to_mqtt.h similarity index 100% rename from usermods/sensors_to_mqtt/usermod_v2_SensorsToMqtt.h rename to usermods/sensors_to_mqtt/sensors_to_mqtt.h diff --git a/usermods/seven_segment_display_reloaded/usermod_seven_segment_reloaded.h b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.h similarity index 100% rename from usermods/seven_segment_display_reloaded/usermod_seven_segment_reloaded.h rename to usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.h diff --git a/usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h b/usermods/stairway_wipe_basic/stairway_wipe_basic.h similarity index 100% rename from usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h rename to usermods/stairway_wipe_basic/stairway_wipe_basic.h diff --git a/usermods/word-clock-matrix/usermod_word_clock_matrix.h b/usermods/word-clock-matrix/word-clock-matrix.h similarity index 100% rename from usermods/word-clock-matrix/usermod_word_clock_matrix.h rename to usermods/word-clock-matrix/word-clock-matrix.h From 6e76a72d78659200f369316351c3ea939592f274 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 21:42:41 +0000 Subject: [PATCH 06/64] Convert usermods from header to library --- usermods/ADS1115_v2/{ADS1115_v2.h => ADS1115_v2.cpp} | 5 ++++- usermods/ADS1115_v2/library.json | 9 +++++++++ usermods/AHT10_v2/{AHT10_v2.h => AHT10_v2.cpp} | 5 ++++- usermods/AHT10_v2/library.json | 9 +++++++++ usermods/BH1750_v2/{BH1750_v2.h => BH1750_v2.cpp} | 4 ++++ usermods/BH1750_v2/library.json | 9 +++++++++ usermods/BME280_v2/{BME280_v2.h => BME280_v2.cpp} | 4 ++++ usermods/BME280_v2/library.json | 9 +++++++++ usermods/BME68X_v2/{BME68X_v2.h => BME68X_v2.cpp} | 4 ++++ usermods/BME68X_v2/library.json | 9 +++++++++ usermods/INA226_v2/{INA226_v2.h => INA226_v2.cpp} | 4 ++++ usermods/INA226_v2/library.json | 9 +++++++++ ...rnal_Temperature_v2.h => Internal_Temperature_v2.cpp} | 5 ++++- usermods/Internal_Temperature_v2/library.json | 9 +++++++++ usermods/LD2410_v2/{LD2410_v2.h => LD2410_v2.cpp} | 4 ++++ usermods/LD2410_v2/library.json | 9 +++++++++ usermods/MAX17048_v2/{MAX17048_v2.h => MAX17048_v2.cpp} | 4 ++++ usermods/MAX17048_v2/library.json | 9 +++++++++ usermods/MY9291/{MY9291.h => MY9291.cpp} | 5 ++++- usermods/MY9291/library.json | 9 +++++++++ usermods/TetrisAI_v2/{TetrisAI_v2.h => TetrisAI_v2.cpp} | 4 ++++ usermods/TetrisAI_v2/library.json | 9 +++++++++ usermods/mqtt_switch_v2/library.json | 9 +++++++++ .../{mqtt_switch_v2.h => mqtt_switch_v2.cpp} | 4 ++++ usermods/sensors_to_mqtt/library.json | 9 +++++++++ .../{sensors_to_mqtt.h => sensors_to_mqtt.cpp} | 4 ++++ usermods/seven_segment_display_reloaded/library.json | 9 +++++++++ ...lay_reloaded.h => seven_segment_display_reloaded.cpp} | 4 ++++ usermods/stairway_wipe_basic/library.json | 9 +++++++++ .../{stairway_wipe_basic.h => stairway_wipe_basic.cpp} | 4 ++++ usermods/word-clock-matrix/library.json | 9 +++++++++ .../{word-clock-matrix.h => word-clock-matrix.cpp} | 4 ++++ 32 files changed, 208 insertions(+), 4 deletions(-) rename usermods/ADS1115_v2/{ADS1115_v2.h => ADS1115_v2.cpp} (98%) create mode 100644 usermods/ADS1115_v2/library.json rename usermods/AHT10_v2/{AHT10_v2.h => AHT10_v2.cpp} (98%) create mode 100644 usermods/AHT10_v2/library.json rename usermods/BH1750_v2/{BH1750_v2.h => BH1750_v2.cpp} (99%) create mode 100644 usermods/BH1750_v2/library.json rename usermods/BME280_v2/{BME280_v2.h => BME280_v2.cpp} (99%) create mode 100644 usermods/BME280_v2/library.json rename usermods/BME68X_v2/{BME68X_v2.h => BME68X_v2.cpp} (99%) create mode 100644 usermods/BME68X_v2/library.json rename usermods/INA226_v2/{INA226_v2.h => INA226_v2.cpp} (99%) create mode 100644 usermods/INA226_v2/library.json rename usermods/Internal_Temperature_v2/{Internal_Temperature_v2.h => Internal_Temperature_v2.cpp} (98%) create mode 100644 usermods/Internal_Temperature_v2/library.json rename usermods/LD2410_v2/{LD2410_v2.h => LD2410_v2.cpp} (99%) create mode 100644 usermods/LD2410_v2/library.json rename usermods/MAX17048_v2/{MAX17048_v2.h => MAX17048_v2.cpp} (99%) create mode 100644 usermods/MAX17048_v2/library.json rename usermods/MY9291/{MY9291.h => MY9291.cpp} (94%) create mode 100644 usermods/MY9291/library.json rename usermods/TetrisAI_v2/{TetrisAI_v2.h => TetrisAI_v2.cpp} (99%) create mode 100644 usermods/TetrisAI_v2/library.json create mode 100644 usermods/mqtt_switch_v2/library.json rename usermods/mqtt_switch_v2/{mqtt_switch_v2.h => mqtt_switch_v2.cpp} (98%) create mode 100644 usermods/sensors_to_mqtt/library.json rename usermods/sensors_to_mqtt/{sensors_to_mqtt.h => sensors_to_mqtt.cpp} (98%) create mode 100644 usermods/seven_segment_display_reloaded/library.json rename usermods/seven_segment_display_reloaded/{seven_segment_display_reloaded.h => seven_segment_display_reloaded.cpp} (99%) create mode 100644 usermods/stairway_wipe_basic/library.json rename usermods/stairway_wipe_basic/{stairway_wipe_basic.h => stairway_wipe_basic.cpp} (97%) create mode 100644 usermods/word-clock-matrix/library.json rename usermods/word-clock-matrix/{word-clock-matrix.h => word-clock-matrix.cpp} (99%) diff --git a/usermods/ADS1115_v2/ADS1115_v2.h b/usermods/ADS1115_v2/ADS1115_v2.cpp similarity index 98% rename from usermods/ADS1115_v2/ADS1115_v2.h rename to usermods/ADS1115_v2/ADS1115_v2.cpp index 5e2b4b27..48f91733 100644 --- a/usermods/ADS1115_v2/ADS1115_v2.h +++ b/usermods/ADS1115_v2/ADS1115_v2.cpp @@ -252,4 +252,7 @@ class ADS1115Usermod : public Usermod { int16_t results = ads.getLastConversionResults(); readings[activeChannel] = ads.computeVolts(results); } -}; \ No newline at end of file +}; + +static ADS1115Usermod ads1115_v2; +REGISTER_USERMOD(ads1115_v2); \ No newline at end of file diff --git a/usermods/ADS1115_v2/library.json b/usermods/ADS1115_v2/library.json new file mode 100644 index 00000000..e4b448a0 --- /dev/null +++ b/usermods/ADS1115_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "ADS1115_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/AHT10_v2/AHT10_v2.h b/usermods/AHT10_v2/AHT10_v2.cpp similarity index 98% rename from usermods/AHT10_v2/AHT10_v2.h rename to usermods/AHT10_v2/AHT10_v2.cpp index b5dc1841..171e1575 100644 --- a/usermods/AHT10_v2/AHT10_v2.h +++ b/usermods/AHT10_v2/AHT10_v2.cpp @@ -324,4 +324,7 @@ public: } }; -const char UsermodAHT10::_name[] PROGMEM = "AHTxx"; \ No newline at end of file +const char UsermodAHT10::_name[] PROGMEM = "AHTxx"; + +static UsermodAHT10 aht10_v2; +REGISTER_USERMOD(aht10_v2); \ No newline at end of file diff --git a/usermods/AHT10_v2/library.json b/usermods/AHT10_v2/library.json new file mode 100644 index 00000000..209e97af --- /dev/null +++ b/usermods/AHT10_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "AHT10_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/BH1750_v2/BH1750_v2.h b/usermods/BH1750_v2/BH1750_v2.cpp similarity index 99% rename from usermods/BH1750_v2/BH1750_v2.h rename to usermods/BH1750_v2/BH1750_v2.cpp index 2a2bd463..5bd47624 100644 --- a/usermods/BH1750_v2/BH1750_v2.h +++ b/usermods/BH1750_v2/BH1750_v2.cpp @@ -250,3 +250,7 @@ const char Usermod_BH1750::_maxReadInterval[] PROGMEM = "max-read-interval-ms"; const char Usermod_BH1750::_minReadInterval[] PROGMEM = "min-read-interval-ms"; const char Usermod_BH1750::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscoveryLux"; const char Usermod_BH1750::_offset[] PROGMEM = "offset-lx"; + + +static Usermod_BH1750 bh1750_v2; +REGISTER_USERMOD(bh1750_v2); \ No newline at end of file diff --git a/usermods/BH1750_v2/library.json b/usermods/BH1750_v2/library.json new file mode 100644 index 00000000..662ca354 --- /dev/null +++ b/usermods/BH1750_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "BH1750_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/BME280_v2/BME280_v2.h b/usermods/BME280_v2/BME280_v2.cpp similarity index 99% rename from usermods/BME280_v2/BME280_v2.h rename to usermods/BME280_v2/BME280_v2.cpp index 9168f422..d29451ee 100644 --- a/usermods/BME280_v2/BME280_v2.h +++ b/usermods/BME280_v2/BME280_v2.cpp @@ -479,3 +479,7 @@ public: const char UsermodBME280::_name[] PROGMEM = "BME280/BMP280"; const char UsermodBME280::_enabled[] PROGMEM = "enabled"; + + +static UsermodBME280 bme280_v2; +REGISTER_USERMOD(bme280_v2); \ No newline at end of file diff --git a/usermods/BME280_v2/library.json b/usermods/BME280_v2/library.json new file mode 100644 index 00000000..57d41fb3 --- /dev/null +++ b/usermods/BME280_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "BME280_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/BME68X_v2/BME68X_v2.h b/usermods/BME68X_v2/BME68X_v2.cpp similarity index 99% rename from usermods/BME68X_v2/BME68X_v2.h rename to usermods/BME68X_v2/BME68X_v2.cpp index aca24d0a..5814506b 100644 --- a/usermods/BME68X_v2/BME68X_v2.h +++ b/usermods/BME68X_v2/BME68X_v2.cpp @@ -1112,3 +1112,7 @@ void UsermodBME68X::saveState() { if (WLED_MQTT_CONNECTED) mqtt->publish(charbuffer, 0, false, contbuffer); } } + + +static UsermodBME68X bme68x_v2; +REGISTER_USERMOD(bme68x_v2); \ No newline at end of file diff --git a/usermods/BME68X_v2/library.json b/usermods/BME68X_v2/library.json new file mode 100644 index 00000000..1a8a1f0f --- /dev/null +++ b/usermods/BME68X_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "BME68X_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/INA226_v2/INA226_v2.h b/usermods/INA226_v2/INA226_v2.cpp similarity index 99% rename from usermods/INA226_v2/INA226_v2.h rename to usermods/INA226_v2/INA226_v2.cpp index 52bc3d83..3c79f05b 100644 --- a/usermods/INA226_v2/INA226_v2.h +++ b/usermods/INA226_v2/INA226_v2.cpp @@ -554,3 +554,7 @@ public: }; const char UsermodINA226::_name[] PROGMEM = "INA226"; + + +static UsermodINA226 ina226_v2; +REGISTER_USERMOD(ina226_v2); \ No newline at end of file diff --git a/usermods/INA226_v2/library.json b/usermods/INA226_v2/library.json new file mode 100644 index 00000000..2596b86a --- /dev/null +++ b/usermods/INA226_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "INA226_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/Internal_Temperature_v2/Internal_Temperature_v2.h b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp similarity index 98% rename from usermods/Internal_Temperature_v2/Internal_Temperature_v2.h rename to usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp index 6d4d4577..ab7f907e 100644 --- a/usermods/Internal_Temperature_v2/Internal_Temperature_v2.h +++ b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp @@ -193,4 +193,7 @@ void InternalTemperatureUsermod::publishMqtt(const char *state, bool retain) mqtt->publish(subuf, 0, retain, state); } #endif -} \ No newline at end of file +} + +static InternalTemperatureUsermod internal_temperature_v2; +REGISTER_USERMOD(internal_temperature_v2); \ No newline at end of file diff --git a/usermods/Internal_Temperature_v2/library.json b/usermods/Internal_Temperature_v2/library.json new file mode 100644 index 00000000..38b560da --- /dev/null +++ b/usermods/Internal_Temperature_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "Internal_Temperature_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/LD2410_v2/LD2410_v2.h b/usermods/LD2410_v2/LD2410_v2.cpp similarity index 99% rename from usermods/LD2410_v2/LD2410_v2.h rename to usermods/LD2410_v2/LD2410_v2.cpp index 4d96b32f..51c887fa 100644 --- a/usermods/LD2410_v2/LD2410_v2.h +++ b/usermods/LD2410_v2/LD2410_v2.cpp @@ -235,3 +235,7 @@ void LD2410Usermod::publishMqtt(const char* topic, const char* state, bool retai } #endif } + + +static LD2410Usermod ld2410_v2; +REGISTER_USERMOD(ld2410_v2); \ No newline at end of file diff --git a/usermods/LD2410_v2/library.json b/usermods/LD2410_v2/library.json new file mode 100644 index 00000000..3480cd79 --- /dev/null +++ b/usermods/LD2410_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "LD2410_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/MAX17048_v2/MAX17048_v2.h b/usermods/MAX17048_v2/MAX17048_v2.cpp similarity index 99% rename from usermods/MAX17048_v2/MAX17048_v2.h rename to usermods/MAX17048_v2/MAX17048_v2.cpp index c3a2664a..1a1108cf 100644 --- a/usermods/MAX17048_v2/MAX17048_v2.h +++ b/usermods/MAX17048_v2/MAX17048_v2.cpp @@ -279,3 +279,7 @@ const char Usermod_MAX17048::_enabled[] PROGMEM = "enabled"; const char Usermod_MAX17048::_maxReadInterval[] PROGMEM = "max-read-interval-ms"; const char Usermod_MAX17048::_minReadInterval[] PROGMEM = "min-read-interval-ms"; const char Usermod_MAX17048::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscovery"; + + +static Usermod_MAX17048 max17048_v2; +REGISTER_USERMOD(max17048_v2); \ No newline at end of file diff --git a/usermods/MAX17048_v2/library.json b/usermods/MAX17048_v2/library.json new file mode 100644 index 00000000..72ac0e61 --- /dev/null +++ b/usermods/MAX17048_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "MAX17048_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/MY9291/MY9291.h b/usermods/MY9291/MY9291.cpp similarity index 94% rename from usermods/MY9291/MY9291.h rename to usermods/MY9291/MY9291.cpp index 66bbc34c..ce8d0f00 100644 --- a/usermods/MY9291/MY9291.h +++ b/usermods/MY9291/MY9291.cpp @@ -42,4 +42,7 @@ class MY9291Usermod : public Usermod { uint16_t getId() { return USERMOD_ID_MY9291; } -}; \ No newline at end of file +}; + +static MY9291Usermod my9291; +REGISTER_USERMOD(my9291); \ No newline at end of file diff --git a/usermods/MY9291/library.json b/usermods/MY9291/library.json new file mode 100644 index 00000000..d965f4c3 --- /dev/null +++ b/usermods/MY9291/library.json @@ -0,0 +1,9 @@ +{ + "name:": "MY9291", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/TetrisAI_v2/TetrisAI_v2.h b/usermods/TetrisAI_v2/TetrisAI_v2.cpp similarity index 99% rename from usermods/TetrisAI_v2/TetrisAI_v2.h rename to usermods/TetrisAI_v2/TetrisAI_v2.cpp index 0f7039da..78cdfd22 100644 --- a/usermods/TetrisAI_v2/TetrisAI_v2.h +++ b/usermods/TetrisAI_v2/TetrisAI_v2.cpp @@ -250,3 +250,7 @@ public: return USERMOD_ID_TETRISAI; } }; + + +static TetrisAIUsermod tetrisai_v2; +REGISTER_USERMOD(tetrisai_v2); \ No newline at end of file diff --git a/usermods/TetrisAI_v2/library.json b/usermods/TetrisAI_v2/library.json new file mode 100644 index 00000000..199e5c43 --- /dev/null +++ b/usermods/TetrisAI_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "TetrisAI_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/mqtt_switch_v2/library.json b/usermods/mqtt_switch_v2/library.json new file mode 100644 index 00000000..96695a9c --- /dev/null +++ b/usermods/mqtt_switch_v2/library.json @@ -0,0 +1,9 @@ +{ + "name:": "mqtt_switch_v2", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/mqtt_switch_v2/mqtt_switch_v2.h b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp similarity index 98% rename from usermods/mqtt_switch_v2/mqtt_switch_v2.h rename to usermods/mqtt_switch_v2/mqtt_switch_v2.cpp index 67dfc9cc..d4d823f3 100644 --- a/usermods/mqtt_switch_v2/mqtt_switch_v2.h +++ b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp @@ -157,3 +157,7 @@ inline void UsermodMqttSwitch::updateState(uint8_t pinNr) mqtt->publish(buf, 0, false, "OFF"); } } + + +static UsermodMqttSwitc mqtt_switch_v2; +REGISTER_USERMOD(mqtt_switch_v2); \ No newline at end of file diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json new file mode 100644 index 00000000..dd9a4f3a --- /dev/null +++ b/usermods/sensors_to_mqtt/library.json @@ -0,0 +1,9 @@ +{ + "name:": "sensors_to_mqtt", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/sensors_to_mqtt/sensors_to_mqtt.h b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp similarity index 98% rename from usermods/sensors_to_mqtt/sensors_to_mqtt.h rename to usermods/sensors_to_mqtt/sensors_to_mqtt.cpp index 9b5bd8c8..02f8e8d2 100644 --- a/usermods/sensors_to_mqtt/sensors_to_mqtt.h +++ b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp @@ -276,3 +276,7 @@ public: } } }; + + +static UserMod_SensorsToMQTT sensors_to_mqtt; +REGISTER_USERMOD(sensors_to_mqtt); \ No newline at end of file diff --git a/usermods/seven_segment_display_reloaded/library.json b/usermods/seven_segment_display_reloaded/library.json new file mode 100644 index 00000000..485aa4fd --- /dev/null +++ b/usermods/seven_segment_display_reloaded/library.json @@ -0,0 +1,9 @@ +{ + "name:": "seven_segment_display_reloaded", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.h b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp similarity index 99% rename from usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.h rename to usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp index 1436f8fc..812065d8 100644 --- a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.h +++ b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp @@ -571,3 +571,7 @@ const char UsermodSSDR::_str_years[] PROGMEM = "LED-Numbers-Year"; const char UsermodSSDR::_str_ldrEnabled[] PROGMEM = "enable-auto-brightness"; const char UsermodSSDR::_str_minBrightness[] PROGMEM = "auto-brightness-min"; const char UsermodSSDR::_str_maxBrightness[] PROGMEM = "auto-brightness-max"; + + +static UsermodSSDR seven_segment_display_reloaded; +REGISTER_USERMOD(seven_segment_display_reloaded); \ No newline at end of file diff --git a/usermods/stairway_wipe_basic/library.json b/usermods/stairway_wipe_basic/library.json new file mode 100644 index 00000000..6b3a5236 --- /dev/null +++ b/usermods/stairway_wipe_basic/library.json @@ -0,0 +1,9 @@ +{ + "name:": "stairway_wipe_basic", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/stairway_wipe_basic/stairway_wipe_basic.h b/usermods/stairway_wipe_basic/stairway_wipe_basic.cpp similarity index 97% rename from usermods/stairway_wipe_basic/stairway_wipe_basic.h rename to usermods/stairway_wipe_basic/stairway_wipe_basic.cpp index 707479df..cdb7cd66 100644 --- a/usermods/stairway_wipe_basic/stairway_wipe_basic.h +++ b/usermods/stairway_wipe_basic/stairway_wipe_basic.cpp @@ -126,3 +126,7 @@ void setup() { //More methods can be added in the future, this example will then be extended. //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class! }; + + +static StairwayWipeUsermod stairway_wipe_basic; +REGISTER_USERMOD(stairway_wipe_basic); \ No newline at end of file diff --git a/usermods/word-clock-matrix/library.json b/usermods/word-clock-matrix/library.json new file mode 100644 index 00000000..ed29ae08 --- /dev/null +++ b/usermods/word-clock-matrix/library.json @@ -0,0 +1,9 @@ +{ + "name:": "word-clock-matrix", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "libLDFMode": "chain+", + "libArchive": false + } +} \ No newline at end of file diff --git a/usermods/word-clock-matrix/word-clock-matrix.h b/usermods/word-clock-matrix/word-clock-matrix.cpp similarity index 99% rename from usermods/word-clock-matrix/word-clock-matrix.h rename to usermods/word-clock-matrix/word-clock-matrix.cpp index 82499c0c..c8606003 100644 --- a/usermods/word-clock-matrix/word-clock-matrix.h +++ b/usermods/word-clock-matrix/word-clock-matrix.cpp @@ -336,3 +336,7 @@ public: }; + + +static WordClockMatrix word-clock-matrix; +REGISTER_USERMOD(word-clock-matrix); \ No newline at end of file From 67022beca0aee5edcc45918987217660d0362892 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 22:07:03 +0000 Subject: [PATCH 07/64] Build all usermods --- .github/workflows/build.yml | 7 ++++++- usermods/platformio_override.usermods.ini | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 usermods/platformio_override.usermods.ini diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2bac314f..e1b05b5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} + environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} usermods steps: - uses: actions/checkout@v4 - name: Set up Node.js @@ -57,6 +57,11 @@ jobs: 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 + find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo >> platformio_override.ini + - name: Build firmware run: pio run -e ${{ matrix.environment }} - uses: actions/upload-artifact@v4 diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini new file mode 100644 index 00000000..568b2025 --- /dev/null +++ b/usermods/platformio_override.usermods.ini @@ -0,0 +1,9 @@ +[env:usermods] +board = esp32dev +platform = ${esp32.platform} +platform_packages = ${esp32.platform_packages} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" + ${esp32.AR_build_flags} +lib_deps = ${esp32.lib_deps} +board_build.partitions = ${esp32.default_partitions} From cbed841414c0c6e388c3abac71f3063a5c472323 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 22:12:36 +0000 Subject: [PATCH 08/64] Include basic usermods in CI --- .github/workflows/build.yml | 3 ++- platformio.ini | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1b05b5a..efdb3f7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} usermods + environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} steps: - uses: actions/checkout@v4 - name: Set up Node.js @@ -60,6 +60,7 @@ jobs: - name: Add usermods environment run: | cp -v usermods/platformio_override.usermods.ini platformio_override.ini + echo -n "custom_usermods = " >> platformio_override.ini find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo >> platformio_override.ini - name: Build firmware diff --git a/platformio.ini b/platformio.ini index 4832978a..156feb06 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ # ------------------------------------------------------------------------------ # CI/release binaries -default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover +default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover, usermods src_dir = ./wled00 data_dir = ./wled00/data @@ -636,3 +636,13 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME= ; -D STATUSLED=15 ${esp32.AR_build_flags} lib_deps = ${esp32s2.lib_deps} + + +[env:usermods] +board = esp32dev +platform = ${esp32.platform} +platform_packages = ${esp32.platform_packages} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" + ${esp32.AR_build_flags} +lib_deps = ${esp32.lib_deps} From c16d83fab00c6a3bb8510bc269f46d2082b41cef Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 22:36:06 +0000 Subject: [PATCH 09/64] Build custom_usermods = audioreactive auto_save animartrix --- platformio.ini | 2 +- wled00/wled.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 156feb06..7eef1775 100644 --- a/platformio.ini +++ b/platformio.ini @@ -420,7 +420,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME= board = esp32dev platform = ${esp32.platform} platform_packages = ${esp32.platform_packages} -custom_usermods = audioreactive +custom_usermods = audioreactive auto_save usermod_v2_animartrix build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET ${esp32.AR_build_flags} diff --git a/wled00/wled.h b/wled00/wled.h index ae93d954..5a1a9ff8 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -1,3 +1,6 @@ +// TODO: HACK!! - do not merge +#define LOROL_LITTLEFS 1 + #ifndef WLED_H #define WLED_H /* From d64cedd3fc94080277524942f3170a7c06d8e1bf Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 22:38:57 +0000 Subject: [PATCH 10/64] Build custom_usermods = audioreactive auto_save animartrix --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 7eef1775..00ddd815 100644 --- a/platformio.ini +++ b/platformio.ini @@ -420,7 +420,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME= board = esp32dev platform = ${esp32.platform} platform_packages = ${esp32.platform_packages} -custom_usermods = audioreactive auto_save usermod_v2_animartrix +custom_usermods = audioreactive auto_save animartrix build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET ${esp32.AR_build_flags} From 2381e323c1dcb13c176d691bbf9871d7e5282fcd Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 22:54:28 +0000 Subject: [PATCH 11/64] Define dependencies for ADS1115 usermod --- platformio.ini | 3 --- usermods/ADS1115_v2/library.json | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 00ddd815..e52afb3b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -158,9 +158,6 @@ lib_deps = ;adafruit/Adafruit BMP280 Library @ 2.1.0 ;adafruit/Adafruit CCS811 Library @ 1.0.4 ;adafruit/Adafruit Si7021 Library @ 1.4.0 - #For ADS1115 sensor uncomment following - ;adafruit/Adafruit BusIO @ 1.13.2 - ;adafruit/Adafruit ADS1X15 @ 2.4.0 #For MAX1704x Lipo Monitor / Fuel Gauge uncomment following ; https://github.com/adafruit/Adafruit_BusIO @ 1.14.5 ; https://github.com/adafruit/Adafruit_MAX1704X @ 1.0.2 diff --git a/usermods/ADS1115_v2/library.json b/usermods/ADS1115_v2/library.json index e4b448a0..179a56e5 100644 --- a/usermods/ADS1115_v2/library.json +++ b/usermods/ADS1115_v2/library.json @@ -5,5 +5,9 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "Adafruit BusIO": "https://github.com/adafruit/Adafruit_BusIO#1.13.2", + "Adafruit ADS1X15": "https://github.com/adafruit/Adafruit_ADS1X15#2.4.0" } -} \ No newline at end of file +} From 79bac912aa7164b18efddf676397e0b8755e4fca Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 11 Jan 2025 23:25:05 +0000 Subject: [PATCH 12/64] use bigger partitions for usermods env --- usermods/AHT10_v2/library.json | 5 ++++- usermods/AHT10_v2/platformio_override.ini | 4 ---- usermods/BH1750_v2/library.json | 5 ++++- usermods/BH1750_v2/readme.md | 11 ----------- usermods/Temperature/library.json | 5 ++++- usermods/Temperature/platformio_override.ini | 6 +----- usermods/platformio_override.usermods.ini | 2 +- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/usermods/AHT10_v2/library.json b/usermods/AHT10_v2/library.json index 209e97af..28bac435 100644 --- a/usermods/AHT10_v2/library.json +++ b/usermods/AHT10_v2/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "enjoyneering/AHT10":"~1.1.0" } -} \ No newline at end of file +} diff --git a/usermods/AHT10_v2/platformio_override.ini b/usermods/AHT10_v2/platformio_override.ini index 30240f22..74dcd659 100644 --- a/usermods/AHT10_v2/platformio_override.ini +++ b/usermods/AHT10_v2/platformio_override.ini @@ -2,8 +2,4 @@ extends = env:esp32dev build_flags = ${common.build_flags} ${esp32.build_flags} - -D USERMOD_AHT10 ; -D USERMOD_AHT10_DEBUG ; -- add a debug status to the info modal -lib_deps = - ${esp32.lib_deps} - enjoyneering/AHT10@~1.1.0 \ No newline at end of file diff --git a/usermods/BH1750_v2/library.json b/usermods/BH1750_v2/library.json index 662ca354..0211bc88 100644 --- a/usermods/BH1750_v2/library.json +++ b/usermods/BH1750_v2/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "claws/BH1750":"^1.2.0" } -} \ No newline at end of file +} diff --git a/usermods/BH1750_v2/readme.md b/usermods/BH1750_v2/readme.md index 6e6c693d..c4aa8cb4 100644 --- a/usermods/BH1750_v2/readme.md +++ b/usermods/BH1750_v2/readme.md @@ -6,22 +6,11 @@ The luminance is displayed in both the Info section of the web UI, as well as pu ## Dependencies - Libraries - `claws/BH1750 @^1.2.0` - - This must be added under `lib_deps` in your `platformio.ini` (or `platformio_override.ini`). - Data is published over MQTT - make sure you've enabled the MQTT sync interface. ## Compilation To enable, compile with `USERMOD_BH1750` defined (e.g. in `platformio_override.ini`) -```ini -[env:usermod_BH1750_d1_mini] -extends = env:d1_mini -build_flags = - ${common.build_flags_esp8266} - -D USERMOD_BH1750 -lib_deps = - ${esp8266.lib_deps} - claws/BH1750 @ ^1.2.0 -``` ### Configuration Options The following settings can be set at compile-time but are configurable on the usermod menu (except First Measurement time): diff --git a/usermods/Temperature/library.json b/usermods/Temperature/library.json index 56371db4..24de7982 100644 --- a/usermods/Temperature/library.json +++ b/usermods/Temperature/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "paulstoffregen/OneWire":"~2.3.8" } -} \ No newline at end of file +} diff --git a/usermods/Temperature/platformio_override.ini b/usermods/Temperature/platformio_override.ini index cc86367f..ed35b7d4 100644 --- a/usermods/Temperature/platformio_override.ini +++ b/usermods/Temperature/platformio_override.ini @@ -3,8 +3,4 @@ ; USERMOD_DALLASTEMPERATURE - define this to have this user mod included wled00\usermods_list.cpp ; USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds ; -[env:d1_mini_usermod_dallas_temperature_C] -extends = env:d1_mini -build_flags = ${common.build_flags_esp8266} -D USERMOD_DALLASTEMPERATURE -lib_deps = ${env.lib_deps} - paulstoffregen/OneWire@~2.3.8 \ No newline at end of file + diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index 568b2025..0035ac59 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -6,4 +6,4 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} -board_build.partitions = ${esp32.default_partitions} +board_build.partitions = ${esp32.big_partitions} \ No newline at end of file From d3eec72e45e4bfae7ada12e45c637058d552a0a8 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 12 Jan 2025 00:09:31 +0000 Subject: [PATCH 13/64] Defining more usermod dependencies --- usermods/BME68X_v2/README.md | 17 ----------------- usermods/BME68X_v2/library.json | 5 ++++- usermods/pixels_dice_tray/library.json | 5 ++++- usermods/pov_display/library.json | 5 ++++- usermods/sensors_to_mqtt/library.json | 8 ++++++-- usermods/sensors_to_mqtt/readme.md | 19 ------------------- usermods/wireguard/library.json | 5 ++++- usermods/wireguard/platformio_override.ini | 22 ---------------------- 8 files changed, 22 insertions(+), 64 deletions(-) delete mode 100644 usermods/wireguard/platformio_override.ini diff --git a/usermods/BME68X_v2/README.md b/usermods/BME68X_v2/README.md index 72ae25a5..7e7a1511 100644 --- a/usermods/BME68X_v2/README.md +++ b/usermods/BME68X_v2/README.md @@ -118,23 +118,6 @@ Methods also exist to read the read/calculated values from other WLED modules th - getStabStatus(); - getRunInStatus(); - -## Compiling - -To enable, compile with `USERMOD_BME68X` defined (e.g. in `platformio_override.ini`) and add the `BSEC Software Library` to the lib_deps. - -``` -[env:esp32-BME680] -board = esp32dev -platform = ${esp32.platform} -platform_packages = ${esp32.platform_packages} -lib_deps = ${esp32.lib_deps} - boschsensortec/BSEC Software Library @ ^1.8.1492 ; USERMOD: BME680 -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp32} - -D USERMOD_BME68X ; USERMOD: BME680 -``` - ## Revision History ### Version 1.0.0 - First version of the BME68X_v user module diff --git a/usermods/BME68X_v2/library.json b/usermods/BME68X_v2/library.json index 1a8a1f0f..ccfac0d9 100644 --- a/usermods/BME68X_v2/library.json +++ b/usermods/BME68X_v2/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "boschsensortec/BSEC Software Library":"^1.8.1492" } -} \ No newline at end of file +} diff --git a/usermods/pixels_dice_tray/library.json b/usermods/pixels_dice_tray/library.json index 01776ffe..4634c407 100644 --- a/usermods/pixels_dice_tray/library.json +++ b/usermods/pixels_dice_tray/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "arduino-pixels-dice":"https://github.com/axlan/arduino-pixels-dice.git" } -} \ No newline at end of file +} diff --git a/usermods/pov_display/library.json b/usermods/pov_display/library.json index 5998377b..a3885417 100644 --- a/usermods/pov_display/library.json +++ b/usermods/pov_display/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "bitbank2/PNGdec":"^1.0.3" } -} \ No newline at end of file +} diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index dd9a4f3a..c1bb6ec8 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -5,5 +5,9 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false - } -} \ No newline at end of file + }, + "dependencies": { + "adafruit/Adafruit BMP280 Library":"2.1.0", + "adafruit/Adafruit CCS811 Library":"1.0.4", + "adafruit/Adafruit Si7021 Library":"1.4.0 +} diff --git a/usermods/sensors_to_mqtt/readme.md b/usermods/sensors_to_mqtt/readme.md index d427d3e1..06162793 100644 --- a/usermods/sensors_to_mqtt/readme.md +++ b/usermods/sensors_to_mqtt/readme.md @@ -60,25 +60,6 @@ SCL_PIN = 5; SDA_PIN = 4; ``` -## Enable in WLED - -1. Copy `usermod_v2_SensorsToMqtt.h` into the `wled00` directory. -2. Add to `build_flags` in platformio.ini: - -``` - -D USERMOD_SENSORSTOMQTT -``` - -3. And add to `lib_deps` in platformio.ini: - -``` - adafruit/Adafruit BMP280 Library @ 2.1.0 - adafruit/Adafruit CCS811 Library @ 1.0.4 - adafruit/Adafruit Si7021 Library @ 1.4.0 -``` - -The #ifdefs in `usermods_list.cpp` should do the rest - # Credits - Aircoookie for making WLED diff --git a/usermods/wireguard/library.json b/usermods/wireguard/library.json index 290f2794..99648400 100644 --- a/usermods/wireguard/library.json +++ b/usermods/wireguard/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "WireGuard-ESP32-Arduino":"https://github.com/kienvu58/WireGuard-ESP32-Arduino.git" } -} \ No newline at end of file +} diff --git a/usermods/wireguard/platformio_override.ini b/usermods/wireguard/platformio_override.ini deleted file mode 100644 index fc0ae5fc..00000000 --- a/usermods/wireguard/platformio_override.ini +++ /dev/null @@ -1,22 +0,0 @@ -# Example PlatformIO Project Configuration Override for WireGuard -# ------------------------------------------------------------------------------ -# Copy to platformio_override.ini to activate. -# ------------------------------------------------------------------------------ -# Please visit documentation: https://docs.platformio.org/page/projectconf.html - -[platformio] -default_envs = WLED_ESP32-WireGuard - -[env:WLED_ESP32-WireGuard] -board = esp32dev -platform = ${esp32.platform} -platform_packages = ${esp32.platform_packages} -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp32} - -D WLED_RELEASE_NAME=ESP32-WireGuard - -D USERMOD_WIREGUARD -lib_deps = ${esp32.lib_deps} - https://github.com/kienvu58/WireGuard-ESP32-Arduino.git -monitor_filters = esp32_exception_decoder -board_build.partitions = ${esp32.default_partitions} -upload_speed = 921600 \ No newline at end of file From 3521732597fb838d5fda5d696c9225a415c991f0 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 12 Jan 2025 00:22:22 +0000 Subject: [PATCH 14/64] fix env:userods --- usermods/platformio_override.usermods.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index 0035ac59..3b3e6696 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -6,4 +6,4 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} -board_build.partitions = ${esp32.big_partitions} \ No newline at end of file +board_build.partitions = ${esp32.big_partitions} From 52b784e0e50c316acb6fdcafb53ec41283386af6 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 12 Jan 2025 00:22:22 +0000 Subject: [PATCH 15/64] fix env:usermods --- usermods/platformio_override.usermods.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index 0035ac59..3b3e6696 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -6,4 +6,4 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} -board_build.partitions = ${esp32.big_partitions} \ No newline at end of file +board_build.partitions = ${esp32.big_partitions} From 52bee88ad2d3c690f57c25140dbf082a6d13745e Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 12 Jan 2025 00:36:08 +0000 Subject: [PATCH 16/64] fix word_clock_matrix naming --- usermods/word-clock-matrix/word-clock-matrix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usermods/word-clock-matrix/word-clock-matrix.cpp b/usermods/word-clock-matrix/word-clock-matrix.cpp index c8606003..6643d293 100644 --- a/usermods/word-clock-matrix/word-clock-matrix.cpp +++ b/usermods/word-clock-matrix/word-clock-matrix.cpp @@ -338,5 +338,5 @@ public: }; -static WordClockMatrix word-clock-matrix; -REGISTER_USERMOD(word-clock-matrix); \ No newline at end of file +static WordClockMatrix word_clock_matrix; +REGISTER_USERMOD(word_clock_matrix); \ No newline at end of file From 075fd4da2d9ddc71f6a755a5a2edddad25fbc4d2 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 12 Jan 2025 01:38:48 +0000 Subject: [PATCH 17/64] Defining more usermod dependencies --- usermods/DHT/library.json | 5 +++- usermods/INA226_v2/library.json | 5 +++- usermods/MAX17048_v2/library.json | 5 +++- usermods/ST7789_display/README.md | 13 ---------- usermods/VL53L0X_gestures/library.json | 5 +++- usermods/VL53L0X_gestures/readme.md | 16 ------------- usermods/mpu6050_imu/library.json | 5 +++- usermods/quinled-an-penta/library.json | 6 ++++- .../quinled-an-penta/quinled-an-penta.cpp | 4 ++-- usermods/quinled-an-penta/readme.md | 23 ------------------ usermods/rgb-rotary-encoder/library.json | 5 +++- usermods/rgb-rotary-encoder/readme.md | 24 ------------------- .../rgb-rotary-encoder/rgb-rotary-encoder.cpp | 4 ++-- 13 files changed, 33 insertions(+), 87 deletions(-) diff --git a/usermods/DHT/library.json b/usermods/DHT/library.json index bb677361..ec7158d2 100644 --- a/usermods/DHT/library.json +++ b/usermods/DHT/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "DHT_nonblocking":"https://github.com/alwynallan/DHT_nonblocking" } -} \ No newline at end of file +} diff --git a/usermods/INA226_v2/library.json b/usermods/INA226_v2/library.json index 2596b86a..be6987e2 100644 --- a/usermods/INA226_v2/library.json +++ b/usermods/INA226_v2/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "wollewald/INA226_WE":"~1.2.9" } -} \ No newline at end of file +} diff --git a/usermods/MAX17048_v2/library.json b/usermods/MAX17048_v2/library.json index 72ac0e61..f85b33cf 100644 --- a/usermods/MAX17048_v2/library.json +++ b/usermods/MAX17048_v2/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "Adafruit_MAX1704X":"https://github.com/adafruit/Adafruit_MAX1704X#1.0.2" } -} \ No newline at end of file +} diff --git a/usermods/ST7789_display/README.md b/usermods/ST7789_display/README.md index ebaae492..7dd3b599 100644 --- a/usermods/ST7789_display/README.md +++ b/usermods/ST7789_display/README.md @@ -27,19 +27,6 @@ This usermod enables display of the following: ### Platformio.ini changes -In the `platformio.ini` file, uncomment the `TFT_eSPI` line within the [common] section, under `lib_deps`: - -```ini -# platformio.ini -... -[common] -... -lib_deps = - ... - #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line - #TFT_eSPI -... -``` In the `platformio.ini` file, you must change the environment setup to build for just the esp32dev platform as follows: diff --git a/usermods/VL53L0X_gestures/library.json b/usermods/VL53L0X_gestures/library.json index 77521d6f..6dfe4c4d 100644 --- a/usermods/VL53L0X_gestures/library.json +++ b/usermods/VL53L0X_gestures/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "pololu/VL53L0X" : "^1.3.0" } -} \ No newline at end of file +} diff --git a/usermods/VL53L0X_gestures/readme.md b/usermods/VL53L0X_gestures/readme.md index a230b1a6..04c4a4aa 100644 --- a/usermods/VL53L0X_gestures/readme.md +++ b/usermods/VL53L0X_gestures/readme.md @@ -10,20 +10,4 @@ Useful for controlling strips when you want to avoid touching anything. 1. Attach VL53L0X sensor to i2c pins according to default pins for your board. 2. Add `-D USERMOD_VL53L0X_GESTURES` to your build flags at platformio.ini (plaformio_override.ini) for needed environment. -In my case, for example: `build_flags = ${env.build_flags} -D USERMOD_VL53L0X_GESTURES` -3. Add "pololu/VL53L0X" dependency below to `lib_deps` like this: -```ini -lib_deps = ${env.lib_deps} - pololu/VL53L0X @ ^1.3.0 -``` -My entire `platformio_override.ini` for example (for nodemcu board): -```ini -[platformio] -default_envs = nodemcuv2 - -[env:nodemcuv2] -build_flags = ${env.build_flags} -D USERMOD_VL53L0X_GESTURES -lib_deps = ${env.lib_deps} - pololu/VL53L0X @ ^1.3.0 -``` diff --git a/usermods/mpu6050_imu/library.json b/usermods/mpu6050_imu/library.json index bf86aed6..68db4d2f 100644 --- a/usermods/mpu6050_imu/library.json +++ b/usermods/mpu6050_imu/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "electroniccats/MPU6050":"1.0.1" } -} \ No newline at end of file +} diff --git a/usermods/quinled-an-penta/library.json b/usermods/quinled-an-penta/library.json index 274020d9..2fe3e11a 100644 --- a/usermods/quinled-an-penta/library.json +++ b/usermods/quinled-an-penta/library.json @@ -5,5 +5,9 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "olikraus/U8g2":"~2.28.8", + "robtillaart/SHT85":"~0.3.3" } -} \ No newline at end of file +} diff --git a/usermods/quinled-an-penta/quinled-an-penta.cpp b/usermods/quinled-an-penta/quinled-an-penta.cpp index 612ade03..1fbfd807 100644 --- a/usermods/quinled-an-penta/quinled-an-penta.cpp +++ b/usermods/quinled-an-penta/quinled-an-penta.cpp @@ -754,5 +754,5 @@ const unsigned char QuinLEDAnPentaUsermod::quinLedLogo[] PROGMEM = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -static QuinLEDAnPentaUsermod quinled-an-penta; -REGISTER_USERMOD(quinled-an-penta); \ No newline at end of file +static QuinLEDAnPentaUsermod quinled_an_penta; +REGISTER_USERMOD(quinled_an_penta); \ No newline at end of file diff --git a/usermods/quinled-an-penta/readme.md b/usermods/quinled-an-penta/readme.md index c1260d91..db1f72c4 100644 --- a/usermods/quinled-an-penta/readme.md +++ b/usermods/quinled-an-penta/readme.md @@ -5,29 +5,6 @@ The (un)official usermod to get the best out of the QuinLED-An-Penta (https://qu * "u8g2" by olikraus, v2.28 or higher: https://github.com/olikraus/u8g2 * "SHT85" by Rob Tillaart, v0.2 or higher: https://github.com/RobTillaart/SHT85 -## Usermod installation -Simply copy the below block (build task) to your `platformio_override.ini` and compile WLED using this new build task. Or use an existing one, add the buildflag `-D QUINLED_AN_PENTA` and the below library dependencies. - -ESP32 (**without** ethernet): -``` -[env:custom_esp32dev_usermod_quinled_an_penta] -extends = env:esp32dev -build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 -D QUINLED_AN_PENTA -lib_deps = ${esp32.lib_deps} - olikraus/U8g2@~2.28.8 - robtillaart/SHT85@~0.2.0 -``` - -ESP32 (**with** ethernet): -``` -[env:custom_esp32dev_usermod_quinled_an_penta] -extends = env:esp32dev -build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D WLED_USE_ETHERNET -D QUINLED_AN_PENTA -lib_deps = ${esp32.lib_deps} - olikraus/U8g2@~2.28.8 - robtillaart/SHT85@~0.2.0 -``` - ## Some words about the (optional) OLED This mod has been optimized for an SSD1306 driven 128x64 OLED. Using a smaller OLED or an OLED using a different driver will result in unexpected results. I highly recommend using these "two color monochromatic OLEDs", which have the first 16 pixels in a different color than the other 48, e.g. a yellow/blue OLED. diff --git a/usermods/rgb-rotary-encoder/library.json b/usermods/rgb-rotary-encoder/library.json index c23606c0..dd6169a3 100644 --- a/usermods/rgb-rotary-encoder/library.json +++ b/usermods/rgb-rotary-encoder/library.json @@ -5,5 +5,8 @@ "includeDir": "../../wled00", "libLDFMode": "chain+", "libArchive": false + }, + "dependencies": { + "lennarthennigs/ESP Rotary":"^2.1.1" } -} \ No newline at end of file +} diff --git a/usermods/rgb-rotary-encoder/readme.md b/usermods/rgb-rotary-encoder/readme.md index 65317917..abd8a812 100644 --- a/usermods/rgb-rotary-encoder/readme.md +++ b/usermods/rgb-rotary-encoder/readme.md @@ -8,30 +8,6 @@ https://user-images.githubusercontent.com/3090131/124680599-0180ab80-dec7-11eb-9 The actual / original code that controls the LED modes is from Adam Zeloof. I take no credit for it. I ported it to WLED, which involved replacing the LED library he used, (because WLED already has one, so no need to add another one) plus the rotary encoder library because it was not compatible with ESP, only Arduino. It was quite a bit more work than I hoped, but I got there eventually :) -## Requirements -* "ESP Rotary" by Lennart Hennigs, v2.1.1 or higher: https://github.com/LennartHennigs/ESPRotary - -## Usermod installation -Simply copy the below block (build task) to your `platformio_override.ini` and compile WLED using this new build task. Or use an existing one and add the buildflag `-D RGB_ROTARY_ENCODER`. - -ESP32: -``` -[env:custom_esp32dev_usermod_rgb_encoder_board] -extends = env:esp32dev -build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 -D RGB_ROTARY_ENCODER -lib_deps = ${esp32.lib_deps} - lennarthennigs/ESP Rotary@^2.1.1 -``` - -ESP8266 / D1 Mini: -``` -[env:custom_d1_mini_usermod_rgb_encoder_board] -extends = env:d1_mini -build_flags = ${common.build_flags_esp8266} -D RGB_ROTARY_ENCODER -lib_deps = ${esp8266.lib_deps} - lennarthennigs/ESP Rotary@^2.1.1 -``` - ## How to connect the board to your ESP We'll need (minimum) three or (maximum) four GPIOs for the board: * "ea": reports the encoder direction diff --git a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp index 3e7b96bb..5b4e7315 100644 --- a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp +++ b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp @@ -342,5 +342,5 @@ const char RgbRotaryEncoderUsermod::_ledBrightness[] PROGMEM = "LED-Brightne const char RgbRotaryEncoderUsermod::_stepsPerClick[] PROGMEM = "Steps-per-Click"; const char RgbRotaryEncoderUsermod::_incrementPerClick[] PROGMEM = "Increment-per-Click"; -static RgbRotaryEncoderUsermod rgb-rotary-encoder; -REGISTER_USERMOD(rgb-rotary-encoder); \ No newline at end of file +static RgbRotaryEncoderUsermod rgb_rotary_encoder; +REGISTER_USERMOD(rgb_rotary_encoder); \ No newline at end of file From 8527d231e1624244c68ea78cebc996eee61736e0 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 12 Jan 2025 13:12:12 +0000 Subject: [PATCH 18/64] audioreactive: Move flags to library Use a PlatformIO script to move the last of AR_buildflags in to the module itself. --- usermods/audioreactive/library.json | 31 ++++++++++++------------- usermods/audioreactive/override_sqrt.py | 5 ++++ 2 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 usermods/audioreactive/override_sqrt.py diff --git a/usermods/audioreactive/library.json b/usermods/audioreactive/library.json index 658bf943..2ce60ec6 100644 --- a/usermods/audioreactive/library.json +++ b/usermods/audioreactive/library.json @@ -1,17 +1,16 @@ -{ - "name": "audioreactive", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, - "dependencies": [ - { - "owner": "kosme", - "name": "arduinoFFT", - "version": "2.0.1", - "platforms": "espressif32" - } - ] +{ + "name": "audioreactive", + "build": { + "srcDir": ".", + "includeDir": "../../wled00", + "extraScript": "override_sqrt.py" + }, + "dependencies": [ + { + "owner": "kosme", + "name": "arduinoFFT", + "version": "2.0.1", + "platforms": "espressif32" + } + ] } \ No newline at end of file diff --git a/usermods/audioreactive/override_sqrt.py b/usermods/audioreactive/override_sqrt.py new file mode 100644 index 00000000..36aa79df --- /dev/null +++ b/usermods/audioreactive/override_sqrt.py @@ -0,0 +1,5 @@ +Import('env') + +for lb in env.GetLibBuilders(): + if lb.name == "arduinoFFT": + lb.env.Append(CPPDEFINES=[("sqrt_internal", "sqrtf")]) From cc9e9b109cb7a9b85531c707ec4bfb086d1faefb Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 12 Jan 2025 17:07:36 +0000 Subject: [PATCH 19/64] Fix usermod library builds Manage include folders via a second platformio script, fixing builds and removing all the extra boilerplate from usermod library.json files. --- pio-scripts/fixup_usermods.py | 17 +++++++++++++++++ platformio.ini | 1 + usermods/audioreactive/library.json | 2 -- usermods/usermod_v2_animartrix/library.json | 6 ------ usermods/usermod_v2_auto_save/library.json | 7 +------ 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 pio-scripts/fixup_usermods.py diff --git a/pio-scripts/fixup_usermods.py b/pio-scripts/fixup_usermods.py new file mode 100644 index 00000000..5b8cddf3 --- /dev/null +++ b/pio-scripts/fixup_usermods.py @@ -0,0 +1,17 @@ +Import('env') + +# Patch up each usermod's include folders to include anything referenced by wled +# This is because usermods need to include wled.h +lib_builders = env.GetLibBuilders() +um_deps = [dep for dep in lib_builders if "/usermods" in dep.src_dir] +other_deps = [dep for dep in lib_builders if "/usermods" not in dep.src_dir] + +for um in um_deps: + # Add include paths for all non-usermod dependencies + for dep in other_deps: + for dir in dep.get_include_dirs(): + um.env.PrependUnique(CPPPATH=dir) + # Add the wled folder to the include path + um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"]) + +#raise RuntimeError("debug") diff --git a/platformio.ini b/platformio.ini index 4832978a..f8366da0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -115,6 +115,7 @@ extra_scripts = post:pio-scripts/strip-floats.py pre:pio-scripts/user_config_copy.py pre:pio-scripts/load_usermods.py + post:pio-scripts/fixup_usermods.py pre:pio-scripts/build_ui.py ; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging) diff --git a/usermods/audioreactive/library.json b/usermods/audioreactive/library.json index 2ce60ec6..77f30d2c 100644 --- a/usermods/audioreactive/library.json +++ b/usermods/audioreactive/library.json @@ -1,8 +1,6 @@ { "name": "audioreactive", "build": { - "srcDir": ".", - "includeDir": "../../wled00", "extraScript": "override_sqrt.py" }, "dependencies": [ diff --git a/usermods/usermod_v2_animartrix/library.json b/usermods/usermod_v2_animartrix/library.json index f176e72e..4552be33 100644 --- a/usermods/usermod_v2_animartrix/library.json +++ b/usermods/usermod_v2_animartrix/library.json @@ -1,11 +1,5 @@ { "name": "animartrix", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "Animartrix": "https://github.com/netmindz/animartrix.git#b172586" } diff --git a/usermods/usermod_v2_auto_save/library.json b/usermods/usermod_v2_auto_save/library.json index 40676ed5..9d81aa68 100644 --- a/usermods/usermod_v2_auto_save/library.json +++ b/usermods/usermod_v2_auto_save/library.json @@ -1,8 +1,3 @@ { - "name": "auto_save", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+" - } + "name": "auto_save" } \ No newline at end of file From f2626b0fc0e355f013ed8483445b430cc5214846 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 12 Jan 2025 17:09:33 +0000 Subject: [PATCH 20/64] Remove now-obsolete AR_build_flags --- platformio.ini | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/platformio.ini b/platformio.ini index f8366da0..7094b7d2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -260,8 +260,8 @@ lib_deps = ${env.lib_deps} board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs # additional build flags for audioreactive - must be applied globally -AR_build_flags = -D sqrt_internal=sqrtf ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster) -AR_lib_deps = kosme/arduinoFFT @ 2.0.1 ;; for pre-usermod-library platformio_override compatibility +AR_build_flags = ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster) +AR_lib_deps = ;; for pre-usermod-library platformio_override compatibility [esp32_idf_V4] @@ -424,7 +424,6 @@ platform_packages = ${esp32.platform_packages} custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET - ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} @@ -436,7 +435,6 @@ platform_packages = ${esp32_idf_V4.platform_packages} custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET - ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.large_partitions} @@ -452,7 +450,6 @@ platform_packages = ${esp32_idf_V4.platform_packages} custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET - ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.extreme_partitions} @@ -468,7 +465,6 @@ board_build.flash_mode = dio ;custom_usermods = audioreactive ;build_unflags = ${common.build_unflags} ;build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_audioreactive\" #-D WLED_DISABLE_BROWNOUT_DET -; ${esp32.AR_build_flags} ;lib_deps = ${esp32.lib_deps} ;monitor_filters = esp32_exception_decoder ;board_build.partitions = ${esp32.default_partitions} @@ -484,7 +480,6 @@ custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 ; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only - ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.default_partitions} @@ -501,7 +496,6 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_WROVER\" -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ;; Older ESP32 (rev.<3) need a PSRAM fix (increases static RAM used) https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/external-ram.html -D DATA_PINS=25 - ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} [env:esp32c3dev] @@ -534,7 +528,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= ;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip -D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB") -DBOARD_HAS_PSRAM - ${esp32.AR_build_flags} lib_deps = ${esp32s3.lib_deps} board_build.partitions = ${esp32.extreme_partitions} board_upload.flash_size = 16MB @@ -557,7 +550,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= ;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip -D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB") -DBOARD_HAS_PSRAM - ${esp32.AR_build_flags} lib_deps = ${esp32s3.lib_deps} board_build.partitions = ${esp32.large_partitions} board_build.f_flash = 80000000L @@ -582,7 +574,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -D LEDPIN=38 -D DATA_PINS=38 ;; buildin WS2812b LED -D BTNPIN=0 -D RLYPIN=16 -D IRPIN=17 -D AUDIOPIN=-1 -D WLED_DEBUG - ${esp32.AR_build_flags} -D SR_DMTYPE=1 -D I2S_SDPIN=13 -D I2S_CKPIN=14 -D I2S_WSPIN=15 -D MCLK_PIN=4 ;; I2S mic lib_deps = ${esp32s3.lib_deps} @@ -604,7 +595,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= -DBOARD_HAS_PSRAM -DLOLIN_WIFI_FIX ; seems to work much better with this -D WLED_WATCHDOG_TIMEOUT=0 - ${esp32.AR_build_flags} lib_deps = ${esp32s3.lib_deps} board_build.partitions = ${esp32.default_partitions} board_build.f_flash = 80000000L @@ -635,5 +625,4 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME= -D HW_PIN_DATASPI=11 -D HW_PIN_MISOSPI=9 ; -D STATUSLED=15 - ${esp32.AR_build_flags} lib_deps = ${esp32s2.lib_deps} From 24accf96a859c0e4023a5db925d7ecc3898aebf7 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 13 Jan 2025 10:53:24 +0000 Subject: [PATCH 21/64] Remove now redundant build section from library.json --- usermods/ADS1115_v2/library.json | 6 ------ usermods/AHT10_v2/library.json | 6 ------ usermods/Analog_Clock/library.json | 8 +------- usermods/Animated_Staircase/library.json | 8 +------- usermods/BH1750_v2/library.json | 6 ------ usermods/BME280_v2/library.json | 8 +------- usermods/BME68X_v2/library.json | 6 ------ usermods/Battery/library.json | 8 +------- usermods/Cronixie/library.json | 8 +------- usermods/DHT/library.json | 6 ------ usermods/EleksTube_IPS/library.json | 8 +------- usermods/INA226_v2/library.json | 6 ------ usermods/Internal_Temperature_v2/library.json | 8 +------- usermods/LD2410_v2/library.json | 8 +------- usermods/LDR_Dusk_Dawn_v2/library.json | 8 +------- usermods/MAX17048_v2/library.json | 6 ------ usermods/MY9291/library.json | 8 +------- usermods/PIR_sensor_switch/library.json | 8 +------- usermods/PWM_fan/library.json | 8 +------- usermods/RTC/library.json | 8 +------- usermods/SN_Photoresistor/library.json | 8 +------- usermods/ST7789_display/library.json | 8 +------- usermods/Si7021_MQTT_HA/library.json | 8 +------- usermods/Temperature/library.json | 6 ------ usermods/TetrisAI_v2/library.json | 8 +------- usermods/VL53L0X_gestures/library.json | 6 ------ usermods/audioreactive/library.json | 8 +------- usermods/boblight/library.json | 8 +------- usermods/buzzer/library.json | 8 +------- usermods/deep_sleep/library.json | 8 +------- usermods/mpu6050_imu/library.json | 6 ------ usermods/mqtt_switch_v2/library.json | 8 +------- usermods/multi_relay/library.json | 8 +------- usermods/pixels_dice_tray/library.json | 6 ------ usermods/pov_display/library.json | 6 ------ usermods/pwm_outputs/library.json | 8 +------- usermods/quinled-an-penta/library.json | 6 ------ usermods/rgb-rotary-encoder/library.json | 6 ------ usermods/sd_card/library.json | 8 +------- usermods/sensors_to_mqtt/library.json | 6 ------ usermods/seven_segment_display/library.json | 8 +------- usermods/seven_segment_display_reloaded/library.json | 8 +------- usermods/sht/library.json | 8 +------- usermods/smartnest/library.json | 8 +------- usermods/stairway_wipe_basic/library.json | 8 +------- usermods/usermod_rotary_brightness_color/library.json | 8 +------- usermods/usermod_v2_HttpPullLightControl/library.json | 8 +------- usermods/usermod_v2_animartrix/library.json | 6 ------ usermods/usermod_v2_auto_save/library.json | 9 ++------- usermods/usermod_v2_four_line_display_ALT/library.json | 8 +------- usermods/usermod_v2_klipper_percentage/library.json | 8 +------- usermods/usermod_v2_ping_pong_clock/library.json | 8 +------- usermods/usermod_v2_rotary_encoder_ui_ALT/library.json | 8 +------- usermods/usermod_v2_word_clock/library.json | 8 +------- usermods/wireguard/library.json | 6 ------ usermods/wizlights/library.json | 8 +------- usermods/word-clock-matrix/library.json | 8 +------- 57 files changed, 41 insertions(+), 382 deletions(-) diff --git a/usermods/ADS1115_v2/library.json b/usermods/ADS1115_v2/library.json index 179a56e5..0b93c935 100644 --- a/usermods/ADS1115_v2/library.json +++ b/usermods/ADS1115_v2/library.json @@ -1,11 +1,5 @@ { "name:": "ADS1115_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "Adafruit BusIO": "https://github.com/adafruit/Adafruit_BusIO#1.13.2", "Adafruit ADS1X15": "https://github.com/adafruit/Adafruit_ADS1X15#2.4.0" diff --git a/usermods/AHT10_v2/library.json b/usermods/AHT10_v2/library.json index 28bac435..94a206c5 100644 --- a/usermods/AHT10_v2/library.json +++ b/usermods/AHT10_v2/library.json @@ -1,11 +1,5 @@ { "name:": "AHT10_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "enjoyneering/AHT10":"~1.1.0" } diff --git a/usermods/Analog_Clock/library.json b/usermods/Analog_Clock/library.json index ddba3a76..4936950e 100644 --- a/usermods/Analog_Clock/library.json +++ b/usermods/Analog_Clock/library.json @@ -1,9 +1,3 @@ { - "name:": "Analog_Clock", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "Analog_Clock" } \ No newline at end of file diff --git a/usermods/Animated_Staircase/library.json b/usermods/Animated_Staircase/library.json index e37df311..626baa49 100644 --- a/usermods/Animated_Staircase/library.json +++ b/usermods/Animated_Staircase/library.json @@ -1,9 +1,3 @@ { - "name:": "Animated_Staircase", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "Animated_Staircase" } \ No newline at end of file diff --git a/usermods/BH1750_v2/library.json b/usermods/BH1750_v2/library.json index 0211bc88..b7f006cc 100644 --- a/usermods/BH1750_v2/library.json +++ b/usermods/BH1750_v2/library.json @@ -1,11 +1,5 @@ { "name:": "BH1750_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "claws/BH1750":"^1.2.0" } diff --git a/usermods/BME280_v2/library.json b/usermods/BME280_v2/library.json index 57d41fb3..126cb362 100644 --- a/usermods/BME280_v2/library.json +++ b/usermods/BME280_v2/library.json @@ -1,9 +1,3 @@ { - "name:": "BME280_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "BME280_v2" } \ No newline at end of file diff --git a/usermods/BME68X_v2/library.json b/usermods/BME68X_v2/library.json index ccfac0d9..3a0e4948 100644 --- a/usermods/BME68X_v2/library.json +++ b/usermods/BME68X_v2/library.json @@ -1,11 +1,5 @@ { "name:": "BME68X_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "boschsensortec/BSEC Software Library":"^1.8.1492" } diff --git a/usermods/Battery/library.json b/usermods/Battery/library.json index bc0d97a1..3f4774b8 100644 --- a/usermods/Battery/library.json +++ b/usermods/Battery/library.json @@ -1,9 +1,3 @@ { - "name:": "Battery", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "Battery" } \ No newline at end of file diff --git a/usermods/Cronixie/library.json b/usermods/Cronixie/library.json index f0d39d00..d4832764 100644 --- a/usermods/Cronixie/library.json +++ b/usermods/Cronixie/library.json @@ -1,9 +1,3 @@ { - "name:": "Cronixie", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "Cronixie" } \ No newline at end of file diff --git a/usermods/DHT/library.json b/usermods/DHT/library.json index ec7158d2..5f2d27f0 100644 --- a/usermods/DHT/library.json +++ b/usermods/DHT/library.json @@ -1,11 +1,5 @@ { "name:": "DHT", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "DHT_nonblocking":"https://github.com/alwynallan/DHT_nonblocking" } diff --git a/usermods/EleksTube_IPS/library.json b/usermods/EleksTube_IPS/library.json index d025fc78..27d71861 100644 --- a/usermods/EleksTube_IPS/library.json +++ b/usermods/EleksTube_IPS/library.json @@ -1,9 +1,3 @@ { - "name:": "EleksTube_IPS", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "EleksTube_IPS" } \ No newline at end of file diff --git a/usermods/INA226_v2/library.json b/usermods/INA226_v2/library.json index be6987e2..91a735fe 100644 --- a/usermods/INA226_v2/library.json +++ b/usermods/INA226_v2/library.json @@ -1,11 +1,5 @@ { "name:": "INA226_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "wollewald/INA226_WE":"~1.2.9" } diff --git a/usermods/Internal_Temperature_v2/library.json b/usermods/Internal_Temperature_v2/library.json index 38b560da..6c165238 100644 --- a/usermods/Internal_Temperature_v2/library.json +++ b/usermods/Internal_Temperature_v2/library.json @@ -1,9 +1,3 @@ { - "name:": "Internal_Temperature_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "Internal_Temperature_v2" } \ No newline at end of file diff --git a/usermods/LD2410_v2/library.json b/usermods/LD2410_v2/library.json index 3480cd79..6fcded02 100644 --- a/usermods/LD2410_v2/library.json +++ b/usermods/LD2410_v2/library.json @@ -1,9 +1,3 @@ { - "name:": "LD2410_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "LD2410_v2" } \ No newline at end of file diff --git a/usermods/LDR_Dusk_Dawn_v2/library.json b/usermods/LDR_Dusk_Dawn_v2/library.json index 6a08c9cc..bb57dbd2 100644 --- a/usermods/LDR_Dusk_Dawn_v2/library.json +++ b/usermods/LDR_Dusk_Dawn_v2/library.json @@ -1,9 +1,3 @@ { - "name:": "LDR_Dusk_Dawn_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "LDR_Dusk_Dawn_v2" } \ No newline at end of file diff --git a/usermods/MAX17048_v2/library.json b/usermods/MAX17048_v2/library.json index f85b33cf..14633345 100644 --- a/usermods/MAX17048_v2/library.json +++ b/usermods/MAX17048_v2/library.json @@ -1,11 +1,5 @@ { "name:": "MAX17048_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "Adafruit_MAX1704X":"https://github.com/adafruit/Adafruit_MAX1704X#1.0.2" } diff --git a/usermods/MY9291/library.json b/usermods/MY9291/library.json index d965f4c3..9324e4a0 100644 --- a/usermods/MY9291/library.json +++ b/usermods/MY9291/library.json @@ -1,9 +1,3 @@ { - "name:": "MY9291", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "MY9291" } \ No newline at end of file diff --git a/usermods/PIR_sensor_switch/library.json b/usermods/PIR_sensor_switch/library.json index 152946e4..0ee7e18b 100644 --- a/usermods/PIR_sensor_switch/library.json +++ b/usermods/PIR_sensor_switch/library.json @@ -1,9 +1,3 @@ { - "name:": "PIR_sensor_switch", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "PIR_sensor_switch" } \ No newline at end of file diff --git a/usermods/PWM_fan/library.json b/usermods/PWM_fan/library.json index a6d5ea64..904d7723 100644 --- a/usermods/PWM_fan/library.json +++ b/usermods/PWM_fan/library.json @@ -1,9 +1,3 @@ { - "name:": "PWM_fan", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "PWM_fan" } \ No newline at end of file diff --git a/usermods/RTC/library.json b/usermods/RTC/library.json index 96aa095b..e0c527d2 100644 --- a/usermods/RTC/library.json +++ b/usermods/RTC/library.json @@ -1,9 +1,3 @@ { - "name:": "RTC", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "RTC" } \ No newline at end of file diff --git a/usermods/SN_Photoresistor/library.json b/usermods/SN_Photoresistor/library.json index fe5173be..7cac93f8 100644 --- a/usermods/SN_Photoresistor/library.json +++ b/usermods/SN_Photoresistor/library.json @@ -1,9 +1,3 @@ { - "name:": "SN_Photoresistor", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "SN_Photoresistor" } \ No newline at end of file diff --git a/usermods/ST7789_display/library.json b/usermods/ST7789_display/library.json index 88f4efe7..abcd4635 100644 --- a/usermods/ST7789_display/library.json +++ b/usermods/ST7789_display/library.json @@ -1,9 +1,3 @@ { - "name:": "ST7789_display", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "ST7789_display" } \ No newline at end of file diff --git a/usermods/Si7021_MQTT_HA/library.json b/usermods/Si7021_MQTT_HA/library.json index 2c18375f..004f9f99 100644 --- a/usermods/Si7021_MQTT_HA/library.json +++ b/usermods/Si7021_MQTT_HA/library.json @@ -1,9 +1,3 @@ { - "name:": "Si7021_MQTT_HA", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "Si7021_MQTT_HA" } \ No newline at end of file diff --git a/usermods/Temperature/library.json b/usermods/Temperature/library.json index 24de7982..6a20a7d3 100644 --- a/usermods/Temperature/library.json +++ b/usermods/Temperature/library.json @@ -1,11 +1,5 @@ { "name:": "Temperature", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "paulstoffregen/OneWire":"~2.3.8" } diff --git a/usermods/TetrisAI_v2/library.json b/usermods/TetrisAI_v2/library.json index 199e5c43..7163dadb 100644 --- a/usermods/TetrisAI_v2/library.json +++ b/usermods/TetrisAI_v2/library.json @@ -1,9 +1,3 @@ { - "name:": "TetrisAI_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "TetrisAI_v2" } \ No newline at end of file diff --git a/usermods/VL53L0X_gestures/library.json b/usermods/VL53L0X_gestures/library.json index 6dfe4c4d..50ff9cb4 100644 --- a/usermods/VL53L0X_gestures/library.json +++ b/usermods/VL53L0X_gestures/library.json @@ -1,11 +1,5 @@ { "name:": "VL53L0X_gestures", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "pololu/VL53L0X" : "^1.3.0" } diff --git a/usermods/audioreactive/library.json b/usermods/audioreactive/library.json index 658bf943..70484d0a 100644 --- a/usermods/audioreactive/library.json +++ b/usermods/audioreactive/library.json @@ -1,11 +1,5 @@ { "name": "audioreactive", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": [ { "owner": "kosme", @@ -14,4 +8,4 @@ "platforms": "espressif32" } ] -} \ No newline at end of file +} diff --git a/usermods/boblight/library.json b/usermods/boblight/library.json index 0b63b224..741d4cb1 100644 --- a/usermods/boblight/library.json +++ b/usermods/boblight/library.json @@ -1,9 +1,3 @@ { - "name:": "boblight", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "boblight" } \ No newline at end of file diff --git a/usermods/buzzer/library.json b/usermods/buzzer/library.json index 78ba4152..6bbcdcc3 100644 --- a/usermods/buzzer/library.json +++ b/usermods/buzzer/library.json @@ -1,9 +1,3 @@ { - "name:": "buzzer", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "buzzer" } \ No newline at end of file diff --git a/usermods/deep_sleep/library.json b/usermods/deep_sleep/library.json index c15e8d57..c8f66de1 100644 --- a/usermods/deep_sleep/library.json +++ b/usermods/deep_sleep/library.json @@ -1,9 +1,3 @@ { - "name:": "deep_sleep", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "deep_sleep" } \ No newline at end of file diff --git a/usermods/mpu6050_imu/library.json b/usermods/mpu6050_imu/library.json index 68db4d2f..29562393 100644 --- a/usermods/mpu6050_imu/library.json +++ b/usermods/mpu6050_imu/library.json @@ -1,11 +1,5 @@ { "name:": "mpu6050_imu", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "electroniccats/MPU6050":"1.0.1" } diff --git a/usermods/mqtt_switch_v2/library.json b/usermods/mqtt_switch_v2/library.json index 96695a9c..cf9abefd 100644 --- a/usermods/mqtt_switch_v2/library.json +++ b/usermods/mqtt_switch_v2/library.json @@ -1,9 +1,3 @@ { - "name:": "mqtt_switch_v2", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "mqtt_switch_v2" } \ No newline at end of file diff --git a/usermods/multi_relay/library.json b/usermods/multi_relay/library.json index 47505d0b..7aa76439 100644 --- a/usermods/multi_relay/library.json +++ b/usermods/multi_relay/library.json @@ -1,9 +1,3 @@ { - "name:": "multi_relay", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "multi_relay" } \ No newline at end of file diff --git a/usermods/pixels_dice_tray/library.json b/usermods/pixels_dice_tray/library.json index 4634c407..fd6a53a5 100644 --- a/usermods/pixels_dice_tray/library.json +++ b/usermods/pixels_dice_tray/library.json @@ -1,11 +1,5 @@ { "name:": "pixels_dice_tray", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "arduino-pixels-dice":"https://github.com/axlan/arduino-pixels-dice.git" } diff --git a/usermods/pov_display/library.json b/usermods/pov_display/library.json index a3885417..298739b5 100644 --- a/usermods/pov_display/library.json +++ b/usermods/pov_display/library.json @@ -1,11 +1,5 @@ { "name:": "pov_display", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "bitbank2/PNGdec":"^1.0.3" } diff --git a/usermods/pwm_outputs/library.json b/usermods/pwm_outputs/library.json index 18ce7d88..4bf07777 100644 --- a/usermods/pwm_outputs/library.json +++ b/usermods/pwm_outputs/library.json @@ -1,9 +1,3 @@ { - "name:": "pwm_outputs", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "pwm_outputs" } \ No newline at end of file diff --git a/usermods/quinled-an-penta/library.json b/usermods/quinled-an-penta/library.json index 2fe3e11a..e89dc002 100644 --- a/usermods/quinled-an-penta/library.json +++ b/usermods/quinled-an-penta/library.json @@ -1,11 +1,5 @@ { "name:": "quinled-an-penta", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "olikraus/U8g2":"~2.28.8", "robtillaart/SHT85":"~0.3.3" diff --git a/usermods/rgb-rotary-encoder/library.json b/usermods/rgb-rotary-encoder/library.json index dd6169a3..25572e11 100644 --- a/usermods/rgb-rotary-encoder/library.json +++ b/usermods/rgb-rotary-encoder/library.json @@ -1,11 +1,5 @@ { "name:": "rgb-rotary-encoder", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "lennarthennigs/ESP Rotary":"^2.1.1" } diff --git a/usermods/sd_card/library.json b/usermods/sd_card/library.json index 777c6264..1f123ead 100644 --- a/usermods/sd_card/library.json +++ b/usermods/sd_card/library.json @@ -1,9 +1,3 @@ { - "name:": "sd_card", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "sd_card" } \ No newline at end of file diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index c1bb6ec8..6594152c 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -1,11 +1,5 @@ { "name:": "sensors_to_mqtt", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "adafruit/Adafruit BMP280 Library":"2.1.0", "adafruit/Adafruit CCS811 Library":"1.0.4", diff --git a/usermods/seven_segment_display/library.json b/usermods/seven_segment_display/library.json index c10bd084..8764e92b 100644 --- a/usermods/seven_segment_display/library.json +++ b/usermods/seven_segment_display/library.json @@ -1,9 +1,3 @@ { - "name:": "seven_segment_display", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "seven_segment_display" } \ No newline at end of file diff --git a/usermods/seven_segment_display_reloaded/library.json b/usermods/seven_segment_display_reloaded/library.json index 485aa4fd..fdce8b53 100644 --- a/usermods/seven_segment_display_reloaded/library.json +++ b/usermods/seven_segment_display_reloaded/library.json @@ -1,9 +1,3 @@ { - "name:": "seven_segment_display_reloaded", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "seven_segment_display_reloaded" } \ No newline at end of file diff --git a/usermods/sht/library.json b/usermods/sht/library.json index 2cb0003a..330093bd 100644 --- a/usermods/sht/library.json +++ b/usermods/sht/library.json @@ -1,9 +1,3 @@ { - "name:": "sht", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "sht" } \ No newline at end of file diff --git a/usermods/smartnest/library.json b/usermods/smartnest/library.json index 4e776ad7..e2c6ab35 100644 --- a/usermods/smartnest/library.json +++ b/usermods/smartnest/library.json @@ -1,9 +1,3 @@ { - "name:": "smartnest", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "smartnest" } \ No newline at end of file diff --git a/usermods/stairway_wipe_basic/library.json b/usermods/stairway_wipe_basic/library.json index 6b3a5236..59cb5da9 100644 --- a/usermods/stairway_wipe_basic/library.json +++ b/usermods/stairway_wipe_basic/library.json @@ -1,9 +1,3 @@ { - "name:": "stairway_wipe_basic", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "stairway_wipe_basic" } \ No newline at end of file diff --git a/usermods/usermod_rotary_brightness_color/library.json b/usermods/usermod_rotary_brightness_color/library.json index 8d368082..777ec19c 100644 --- a/usermods/usermod_rotary_brightness_color/library.json +++ b/usermods/usermod_rotary_brightness_color/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_rotary_brightness_color", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_rotary_brightness_color" } \ No newline at end of file diff --git a/usermods/usermod_v2_HttpPullLightControl/library.json b/usermods/usermod_v2_HttpPullLightControl/library.json index 68b93708..0f66710b 100644 --- a/usermods/usermod_v2_HttpPullLightControl/library.json +++ b/usermods/usermod_v2_HttpPullLightControl/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_v2_HttpPullLightControl", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_v2_HttpPullLightControl" } \ No newline at end of file diff --git a/usermods/usermod_v2_animartrix/library.json b/usermods/usermod_v2_animartrix/library.json index f176e72e..4552be33 100644 --- a/usermods/usermod_v2_animartrix/library.json +++ b/usermods/usermod_v2_animartrix/library.json @@ -1,11 +1,5 @@ { "name": "animartrix", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "Animartrix": "https://github.com/netmindz/animartrix.git#b172586" } diff --git a/usermods/usermod_v2_auto_save/library.json b/usermods/usermod_v2_auto_save/library.json index 40676ed5..67b29ca6 100644 --- a/usermods/usermod_v2_auto_save/library.json +++ b/usermods/usermod_v2_auto_save/library.json @@ -1,8 +1,3 @@ -{ - "name": "auto_save", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+" - } +{ + "name:": "usermod_v2_auto_save" } \ No newline at end of file diff --git a/usermods/usermod_v2_four_line_display_ALT/library.json b/usermods/usermod_v2_four_line_display_ALT/library.json index 6dccb4a9..56612c96 100644 --- a/usermods/usermod_v2_four_line_display_ALT/library.json +++ b/usermods/usermod_v2_four_line_display_ALT/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_v2_four_line_display_ALT", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_v2_four_line_display_ALT" } \ No newline at end of file diff --git a/usermods/usermod_v2_klipper_percentage/library.json b/usermods/usermod_v2_klipper_percentage/library.json index afd96163..b31fb1ad 100644 --- a/usermods/usermod_v2_klipper_percentage/library.json +++ b/usermods/usermod_v2_klipper_percentage/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_v2_klipper_percentage", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_v2_klipper_percentage" } \ No newline at end of file diff --git a/usermods/usermod_v2_ping_pong_clock/library.json b/usermods/usermod_v2_ping_pong_clock/library.json index 19708611..fe23cd91 100644 --- a/usermods/usermod_v2_ping_pong_clock/library.json +++ b/usermods/usermod_v2_ping_pong_clock/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_v2_ping_pong_clock", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_v2_ping_pong_clock" } \ No newline at end of file diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json index f7c60ecd..5f857218 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_v2_rotary_encoder_ui_ALT", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_v2_rotary_encoder_ui_ALT" } \ No newline at end of file diff --git a/usermods/usermod_v2_word_clock/library.json b/usermods/usermod_v2_word_clock/library.json index 74a3d903..83c14dc7 100644 --- a/usermods/usermod_v2_word_clock/library.json +++ b/usermods/usermod_v2_word_clock/library.json @@ -1,9 +1,3 @@ { - "name:": "usermod_v2_word_clock", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "usermod_v2_word_clock" } \ No newline at end of file diff --git a/usermods/wireguard/library.json b/usermods/wireguard/library.json index 99648400..0ebace8b 100644 --- a/usermods/wireguard/library.json +++ b/usermods/wireguard/library.json @@ -1,11 +1,5 @@ { "name:": "wireguard", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - }, "dependencies": { "WireGuard-ESP32-Arduino":"https://github.com/kienvu58/WireGuard-ESP32-Arduino.git" } diff --git a/usermods/wizlights/library.json b/usermods/wizlights/library.json index a82dd7fc..687fba0f 100644 --- a/usermods/wizlights/library.json +++ b/usermods/wizlights/library.json @@ -1,9 +1,3 @@ { - "name:": "wizlights", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "wizlights" } \ No newline at end of file diff --git a/usermods/word-clock-matrix/library.json b/usermods/word-clock-matrix/library.json index ed29ae08..d971dfff 100644 --- a/usermods/word-clock-matrix/library.json +++ b/usermods/word-clock-matrix/library.json @@ -1,9 +1,3 @@ { - "name:": "word-clock-matrix", - "build": { - "srcDir": ".", - "includeDir": "../../wled00", - "libLDFMode": "chain+", - "libArchive": false - } + "name:": "word-clock-matrix" } \ No newline at end of file From b380d5e2c7df29820b91b4d7aa4be7350b8d9a9d Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 14 Jan 2025 00:10:55 +0000 Subject: [PATCH 22/64] reinstate libArchive:false --- usermods/ADS1115_v2/library.json | 1 + usermods/AHT10_v2/library.json | 1 + usermods/Analog_Clock/library.json | 3 ++- usermods/Animated_Staircase/library.json | 3 ++- usermods/BH1750_v2/library.json | 1 + usermods/BME280_v2/library.json | 3 ++- usermods/BME68X_v2/library.json | 1 + usermods/Battery/library.json | 3 ++- usermods/Cronixie/library.json | 3 ++- usermods/DHT/library.json | 1 + usermods/EleksTube_IPS/library.json | 3 ++- usermods/INA226_v2/library.json | 1 + usermods/Internal_Temperature_v2/library.json | 3 ++- usermods/LD2410_v2/library.json | 3 ++- usermods/LDR_Dusk_Dawn_v2/library.json | 3 ++- usermods/MAX17048_v2/library.json | 1 + usermods/MY9291/library.json | 3 ++- usermods/PIR_sensor_switch/library.json | 3 ++- usermods/PWM_fan/library.json | 3 ++- usermods/RTC/library.json | 3 ++- usermods/SN_Photoresistor/library.json | 3 ++- usermods/ST7789_display/library.json | 3 ++- usermods/Si7021_MQTT_HA/library.json | 3 ++- usermods/Temperature/library.json | 1 + usermods/TetrisAI_v2/library.json | 3 ++- usermods/VL53L0X_gestures/library.json | 1 + usermods/audioreactive/library.json | 1 + usermods/boblight/library.json | 3 ++- usermods/buzzer/library.json | 3 ++- usermods/deep_sleep/library.json | 3 ++- usermods/mpu6050_imu/library.json | 1 + usermods/mqtt_switch_v2/library.json | 3 ++- usermods/multi_relay/library.json | 3 ++- usermods/pixels_dice_tray/library.json | 1 + usermods/pov_display/library.json | 1 + usermods/pwm_outputs/library.json | 3 ++- usermods/quinled-an-penta/library.json | 1 + usermods/rgb-rotary-encoder/library.json | 1 + usermods/sd_card/library.json | 3 ++- usermods/sensors_to_mqtt/library.json | 1 + usermods/seven_segment_display/library.json | 3 ++- usermods/seven_segment_display_reloaded/library.json | 3 ++- usermods/sht/library.json | 3 ++- usermods/smartnest/library.json | 3 ++- usermods/stairway_wipe_basic/library.json | 3 ++- usermods/usermod_rotary_brightness_color/library.json | 3 ++- usermods/usermod_v2_HttpPullLightControl/library.json | 3 ++- usermods/usermod_v2_animartrix/library.json | 1 + usermods/usermod_v2_auto_save/library.json | 3 ++- usermods/usermod_v2_four_line_display_ALT/library.json | 3 ++- usermods/usermod_v2_klipper_percentage/library.json | 3 ++- usermods/usermod_v2_ping_pong_clock/library.json | 3 ++- usermods/usermod_v2_rotary_encoder_ui_ALT/library.json | 3 ++- usermods/usermod_v2_word_clock/library.json | 3 ++- usermods/wireguard/library.json | 1 + usermods/wizlights/library.json | 3 ++- usermods/word-clock-matrix/library.json | 3 ++- 57 files changed, 96 insertions(+), 39 deletions(-) diff --git a/usermods/ADS1115_v2/library.json b/usermods/ADS1115_v2/library.json index 0b93c935..0ce2039f 100644 --- a/usermods/ADS1115_v2/library.json +++ b/usermods/ADS1115_v2/library.json @@ -1,5 +1,6 @@ { "name:": "ADS1115_v2", + "build": { "libArchive": false }, "dependencies": { "Adafruit BusIO": "https://github.com/adafruit/Adafruit_BusIO#1.13.2", "Adafruit ADS1X15": "https://github.com/adafruit/Adafruit_ADS1X15#2.4.0" diff --git a/usermods/AHT10_v2/library.json b/usermods/AHT10_v2/library.json index 94a206c5..b4501ed7 100644 --- a/usermods/AHT10_v2/library.json +++ b/usermods/AHT10_v2/library.json @@ -1,5 +1,6 @@ { "name:": "AHT10_v2", + "build": { "libArchive": false }, "dependencies": { "enjoyneering/AHT10":"~1.1.0" } diff --git a/usermods/Analog_Clock/library.json b/usermods/Analog_Clock/library.json index 4936950e..7a2fc50d 100644 --- a/usermods/Analog_Clock/library.json +++ b/usermods/Analog_Clock/library.json @@ -1,3 +1,4 @@ { - "name:": "Analog_Clock" + "name:": "Analog_Clock", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/Animated_Staircase/library.json b/usermods/Animated_Staircase/library.json index 626baa49..73dc3f1b 100644 --- a/usermods/Animated_Staircase/library.json +++ b/usermods/Animated_Staircase/library.json @@ -1,3 +1,4 @@ { - "name:": "Animated_Staircase" + "name:": "Animated_Staircase", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/BH1750_v2/library.json b/usermods/BH1750_v2/library.json index b7f006cc..2ce4054f 100644 --- a/usermods/BH1750_v2/library.json +++ b/usermods/BH1750_v2/library.json @@ -1,5 +1,6 @@ { "name:": "BH1750_v2", + "build": { "libArchive": false }, "dependencies": { "claws/BH1750":"^1.2.0" } diff --git a/usermods/BME280_v2/library.json b/usermods/BME280_v2/library.json index 126cb362..faae0f34 100644 --- a/usermods/BME280_v2/library.json +++ b/usermods/BME280_v2/library.json @@ -1,3 +1,4 @@ { - "name:": "BME280_v2" + "name:": "BME280_v2", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/BME68X_v2/library.json b/usermods/BME68X_v2/library.json index 3a0e4948..6bd0bb9b 100644 --- a/usermods/BME68X_v2/library.json +++ b/usermods/BME68X_v2/library.json @@ -1,5 +1,6 @@ { "name:": "BME68X_v2", + "build": { "libArchive": false}, "dependencies": { "boschsensortec/BSEC Software Library":"^1.8.1492" } diff --git a/usermods/Battery/library.json b/usermods/Battery/library.json index 3f4774b8..85be8542 100644 --- a/usermods/Battery/library.json +++ b/usermods/Battery/library.json @@ -1,3 +1,4 @@ { - "name:": "Battery" + "name:": "Battery", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/Cronixie/library.json b/usermods/Cronixie/library.json index d4832764..d22bfa45 100644 --- a/usermods/Cronixie/library.json +++ b/usermods/Cronixie/library.json @@ -1,3 +1,4 @@ { - "name:": "Cronixie" + "name:": "Cronixie", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/DHT/library.json b/usermods/DHT/library.json index 5f2d27f0..d61634e9 100644 --- a/usermods/DHT/library.json +++ b/usermods/DHT/library.json @@ -1,5 +1,6 @@ { "name:": "DHT", + "build": { "libArchive": false}, "dependencies": { "DHT_nonblocking":"https://github.com/alwynallan/DHT_nonblocking" } diff --git a/usermods/EleksTube_IPS/library.json b/usermods/EleksTube_IPS/library.json index 27d71861..e5ed6219 100644 --- a/usermods/EleksTube_IPS/library.json +++ b/usermods/EleksTube_IPS/library.json @@ -1,3 +1,4 @@ { - "name:": "EleksTube_IPS" + "name:": "EleksTube_IPS", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/INA226_v2/library.json b/usermods/INA226_v2/library.json index 91a735fe..3633c3a7 100644 --- a/usermods/INA226_v2/library.json +++ b/usermods/INA226_v2/library.json @@ -1,5 +1,6 @@ { "name:": "INA226_v2", + "build": { "libArchive": false}, "dependencies": { "wollewald/INA226_WE":"~1.2.9" } diff --git a/usermods/Internal_Temperature_v2/library.json b/usermods/Internal_Temperature_v2/library.json index 6c165238..dc0ae30a 100644 --- a/usermods/Internal_Temperature_v2/library.json +++ b/usermods/Internal_Temperature_v2/library.json @@ -1,3 +1,4 @@ { - "name:": "Internal_Temperature_v2" + "name:": "Internal_Temperature_v2", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/LD2410_v2/library.json b/usermods/LD2410_v2/library.json index 6fcded02..faef37d4 100644 --- a/usermods/LD2410_v2/library.json +++ b/usermods/LD2410_v2/library.json @@ -1,3 +1,4 @@ { - "name:": "LD2410_v2" + "name:": "LD2410_v2", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/LDR_Dusk_Dawn_v2/library.json b/usermods/LDR_Dusk_Dawn_v2/library.json index bb57dbd2..c5e98620 100644 --- a/usermods/LDR_Dusk_Dawn_v2/library.json +++ b/usermods/LDR_Dusk_Dawn_v2/library.json @@ -1,3 +1,4 @@ { - "name:": "LDR_Dusk_Dawn_v2" + "name:": "LDR_Dusk_Dawn_v2", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/MAX17048_v2/library.json b/usermods/MAX17048_v2/library.json index 14633345..03b9acd9 100644 --- a/usermods/MAX17048_v2/library.json +++ b/usermods/MAX17048_v2/library.json @@ -1,5 +1,6 @@ { "name:": "MAX17048_v2", + "build": { "libArchive": false}, "dependencies": { "Adafruit_MAX1704X":"https://github.com/adafruit/Adafruit_MAX1704X#1.0.2" } diff --git a/usermods/MY9291/library.json b/usermods/MY9291/library.json index 9324e4a0..ddf7aa09 100644 --- a/usermods/MY9291/library.json +++ b/usermods/MY9291/library.json @@ -1,3 +1,4 @@ { - "name:": "MY9291" + "name:": "MY9291", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/PIR_sensor_switch/library.json b/usermods/PIR_sensor_switch/library.json index 0ee7e18b..1c08ccc1 100644 --- a/usermods/PIR_sensor_switch/library.json +++ b/usermods/PIR_sensor_switch/library.json @@ -1,3 +1,4 @@ { - "name:": "PIR_sensor_switch" + "name:": "PIR_sensor_switch", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/PWM_fan/library.json b/usermods/PWM_fan/library.json index 904d7723..67f02620 100644 --- a/usermods/PWM_fan/library.json +++ b/usermods/PWM_fan/library.json @@ -1,3 +1,4 @@ { - "name:": "PWM_fan" + "name:": "PWM_fan", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/RTC/library.json b/usermods/RTC/library.json index e0c527d2..17bc0d53 100644 --- a/usermods/RTC/library.json +++ b/usermods/RTC/library.json @@ -1,3 +1,4 @@ { - "name:": "RTC" + "name:": "RTC", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/SN_Photoresistor/library.json b/usermods/SN_Photoresistor/library.json index 7cac93f8..8e34ed3b 100644 --- a/usermods/SN_Photoresistor/library.json +++ b/usermods/SN_Photoresistor/library.json @@ -1,3 +1,4 @@ { - "name:": "SN_Photoresistor" + "name:": "SN_Photoresistor", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/ST7789_display/library.json b/usermods/ST7789_display/library.json index abcd4635..725e20a6 100644 --- a/usermods/ST7789_display/library.json +++ b/usermods/ST7789_display/library.json @@ -1,3 +1,4 @@ { - "name:": "ST7789_display" + "name:": "ST7789_display", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/Si7021_MQTT_HA/library.json b/usermods/Si7021_MQTT_HA/library.json index 004f9f99..60991a3e 100644 --- a/usermods/Si7021_MQTT_HA/library.json +++ b/usermods/Si7021_MQTT_HA/library.json @@ -1,3 +1,4 @@ { - "name:": "Si7021_MQTT_HA" + "name:": "Si7021_MQTT_HA", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/Temperature/library.json b/usermods/Temperature/library.json index 6a20a7d3..0d9f55cc 100644 --- a/usermods/Temperature/library.json +++ b/usermods/Temperature/library.json @@ -1,5 +1,6 @@ { "name:": "Temperature", + "build": { "libArchive": false}, "dependencies": { "paulstoffregen/OneWire":"~2.3.8" } diff --git a/usermods/TetrisAI_v2/library.json b/usermods/TetrisAI_v2/library.json index 7163dadb..b3282288 100644 --- a/usermods/TetrisAI_v2/library.json +++ b/usermods/TetrisAI_v2/library.json @@ -1,3 +1,4 @@ { - "name:": "TetrisAI_v2" + "name:": "TetrisAI_v2", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/VL53L0X_gestures/library.json b/usermods/VL53L0X_gestures/library.json index 50ff9cb4..db24abd0 100644 --- a/usermods/VL53L0X_gestures/library.json +++ b/usermods/VL53L0X_gestures/library.json @@ -1,5 +1,6 @@ { "name:": "VL53L0X_gestures", + "build": { "libArchive": false}, "dependencies": { "pololu/VL53L0X" : "^1.3.0" } diff --git a/usermods/audioreactive/library.json b/usermods/audioreactive/library.json index 70484d0a..4984a3bc 100644 --- a/usermods/audioreactive/library.json +++ b/usermods/audioreactive/library.json @@ -1,5 +1,6 @@ { "name": "audioreactive", + "build": { "libArchive": false }, "dependencies": [ { "owner": "kosme", diff --git a/usermods/boblight/library.json b/usermods/boblight/library.json index 741d4cb1..34de5c8f 100644 --- a/usermods/boblight/library.json +++ b/usermods/boblight/library.json @@ -1,3 +1,4 @@ { - "name:": "boblight" + "name:": "boblight", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/buzzer/library.json b/usermods/buzzer/library.json index 6bbcdcc3..6208090c 100644 --- a/usermods/buzzer/library.json +++ b/usermods/buzzer/library.json @@ -1,3 +1,4 @@ { - "name:": "buzzer" + "name:": "buzzer", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/deep_sleep/library.json b/usermods/deep_sleep/library.json index c8f66de1..3f4687ef 100644 --- a/usermods/deep_sleep/library.json +++ b/usermods/deep_sleep/library.json @@ -1,3 +1,4 @@ { - "name:": "deep_sleep" + "name:": "deep_sleep", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/mpu6050_imu/library.json b/usermods/mpu6050_imu/library.json index 29562393..3c39de45 100644 --- a/usermods/mpu6050_imu/library.json +++ b/usermods/mpu6050_imu/library.json @@ -1,5 +1,6 @@ { "name:": "mpu6050_imu", + "build": { "libArchive": false}, "dependencies": { "electroniccats/MPU6050":"1.0.1" } diff --git a/usermods/mqtt_switch_v2/library.json b/usermods/mqtt_switch_v2/library.json index cf9abefd..d6032257 100644 --- a/usermods/mqtt_switch_v2/library.json +++ b/usermods/mqtt_switch_v2/library.json @@ -1,3 +1,4 @@ { - "name:": "mqtt_switch_v2" + "name:": "mqtt_switch_v2", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/multi_relay/library.json b/usermods/multi_relay/library.json index 7aa76439..cb9437e6 100644 --- a/usermods/multi_relay/library.json +++ b/usermods/multi_relay/library.json @@ -1,3 +1,4 @@ { - "name:": "multi_relay" + "name:": "multi_relay", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/pixels_dice_tray/library.json b/usermods/pixels_dice_tray/library.json index fd6a53a5..ce08b801 100644 --- a/usermods/pixels_dice_tray/library.json +++ b/usermods/pixels_dice_tray/library.json @@ -1,5 +1,6 @@ { "name:": "pixels_dice_tray", + "build": { "libArchive": false}, "dependencies": { "arduino-pixels-dice":"https://github.com/axlan/arduino-pixels-dice.git" } diff --git a/usermods/pov_display/library.json b/usermods/pov_display/library.json index 298739b5..2dd944a8 100644 --- a/usermods/pov_display/library.json +++ b/usermods/pov_display/library.json @@ -1,5 +1,6 @@ { "name:": "pov_display", + "build": { "libArchive": false}, "dependencies": { "bitbank2/PNGdec":"^1.0.3" } diff --git a/usermods/pwm_outputs/library.json b/usermods/pwm_outputs/library.json index 4bf07777..bdb9937e 100644 --- a/usermods/pwm_outputs/library.json +++ b/usermods/pwm_outputs/library.json @@ -1,3 +1,4 @@ { - "name:": "pwm_outputs" + "name:": "pwm_outputs", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/quinled-an-penta/library.json b/usermods/quinled-an-penta/library.json index e89dc002..9a1f4e0e 100644 --- a/usermods/quinled-an-penta/library.json +++ b/usermods/quinled-an-penta/library.json @@ -1,5 +1,6 @@ { "name:": "quinled-an-penta", + "build": { "libArchive": false}, "dependencies": { "olikraus/U8g2":"~2.28.8", "robtillaart/SHT85":"~0.3.3" diff --git a/usermods/rgb-rotary-encoder/library.json b/usermods/rgb-rotary-encoder/library.json index 25572e11..b1394ba2 100644 --- a/usermods/rgb-rotary-encoder/library.json +++ b/usermods/rgb-rotary-encoder/library.json @@ -1,5 +1,6 @@ { "name:": "rgb-rotary-encoder", + "build": { "libArchive": false}, "dependencies": { "lennarthennigs/ESP Rotary":"^2.1.1" } diff --git a/usermods/sd_card/library.json b/usermods/sd_card/library.json index 1f123ead..5b8faf16 100644 --- a/usermods/sd_card/library.json +++ b/usermods/sd_card/library.json @@ -1,3 +1,4 @@ { - "name:": "sd_card" + "name:": "sd_card", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index 6594152c..29addddc 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -1,5 +1,6 @@ { "name:": "sensors_to_mqtt", + "build": { "libArchive": false}, "dependencies": { "adafruit/Adafruit BMP280 Library":"2.1.0", "adafruit/Adafruit CCS811 Library":"1.0.4", diff --git a/usermods/seven_segment_display/library.json b/usermods/seven_segment_display/library.json index 8764e92b..6a306119 100644 --- a/usermods/seven_segment_display/library.json +++ b/usermods/seven_segment_display/library.json @@ -1,3 +1,4 @@ { - "name:": "seven_segment_display" + "name:": "seven_segment_display", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/seven_segment_display_reloaded/library.json b/usermods/seven_segment_display_reloaded/library.json index fdce8b53..5fa5037f 100644 --- a/usermods/seven_segment_display_reloaded/library.json +++ b/usermods/seven_segment_display_reloaded/library.json @@ -1,3 +1,4 @@ { - "name:": "seven_segment_display_reloaded" + "name:": "seven_segment_display_reloaded", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/sht/library.json b/usermods/sht/library.json index 330093bd..2788c34a 100644 --- a/usermods/sht/library.json +++ b/usermods/sht/library.json @@ -1,3 +1,4 @@ { - "name:": "sht" + "name:": "sht", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/smartnest/library.json b/usermods/smartnest/library.json index e2c6ab35..7a9d95dd 100644 --- a/usermods/smartnest/library.json +++ b/usermods/smartnest/library.json @@ -1,3 +1,4 @@ { - "name:": "smartnest" + "name:": "smartnest", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/stairway_wipe_basic/library.json b/usermods/stairway_wipe_basic/library.json index 59cb5da9..801846ea 100644 --- a/usermods/stairway_wipe_basic/library.json +++ b/usermods/stairway_wipe_basic/library.json @@ -1,3 +1,4 @@ { - "name:": "stairway_wipe_basic" + "name:": "stairway_wipe_basic", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_rotary_brightness_color/library.json b/usermods/usermod_rotary_brightness_color/library.json index 777ec19c..5e669169 100644 --- a/usermods/usermod_rotary_brightness_color/library.json +++ b/usermods/usermod_rotary_brightness_color/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_rotary_brightness_color" + "name:": "usermod_rotary_brightness_color", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_HttpPullLightControl/library.json b/usermods/usermod_v2_HttpPullLightControl/library.json index 0f66710b..91735b8c 100644 --- a/usermods/usermod_v2_HttpPullLightControl/library.json +++ b/usermods/usermod_v2_HttpPullLightControl/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_HttpPullLightControl" + "name:": "usermod_v2_HttpPullLightControl", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_animartrix/library.json b/usermods/usermod_v2_animartrix/library.json index 4552be33..c9c98c39 100644 --- a/usermods/usermod_v2_animartrix/library.json +++ b/usermods/usermod_v2_animartrix/library.json @@ -1,5 +1,6 @@ { "name": "animartrix", + "build": { "libArchive": false}, "dependencies": { "Animartrix": "https://github.com/netmindz/animartrix.git#b172586" } diff --git a/usermods/usermod_v2_auto_save/library.json b/usermods/usermod_v2_auto_save/library.json index 67b29ca6..b9c39d71 100644 --- a/usermods/usermod_v2_auto_save/library.json +++ b/usermods/usermod_v2_auto_save/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_auto_save" + "name:": "usermod_v2_auto_save", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_four_line_display_ALT/library.json b/usermods/usermod_v2_four_line_display_ALT/library.json index 56612c96..33c277bd 100644 --- a/usermods/usermod_v2_four_line_display_ALT/library.json +++ b/usermods/usermod_v2_four_line_display_ALT/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_four_line_display_ALT" + "name:": "usermod_v2_four_line_display_ALT", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_klipper_percentage/library.json b/usermods/usermod_v2_klipper_percentage/library.json index b31fb1ad..99e0546c 100644 --- a/usermods/usermod_v2_klipper_percentage/library.json +++ b/usermods/usermod_v2_klipper_percentage/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_klipper_percentage" + "name:": "usermod_v2_klipper_percentage", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_ping_pong_clock/library.json b/usermods/usermod_v2_ping_pong_clock/library.json index fe23cd91..b3417b98 100644 --- a/usermods/usermod_v2_ping_pong_clock/library.json +++ b/usermods/usermod_v2_ping_pong_clock/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_ping_pong_clock" + "name:": "usermod_v2_ping_pong_clock", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json index 5f857218..065c67d9 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_rotary_encoder_ui_ALT" + "name:": "usermod_v2_rotary_encoder_ui_ALT", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/usermod_v2_word_clock/library.json b/usermods/usermod_v2_word_clock/library.json index 83c14dc7..9e6a339d 100644 --- a/usermods/usermod_v2_word_clock/library.json +++ b/usermods/usermod_v2_word_clock/library.json @@ -1,3 +1,4 @@ { - "name:": "usermod_v2_word_clock" + "name:": "usermod_v2_word_clock", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/wireguard/library.json b/usermods/wireguard/library.json index 0ebace8b..7c7b17ef 100644 --- a/usermods/wireguard/library.json +++ b/usermods/wireguard/library.json @@ -1,5 +1,6 @@ { "name:": "wireguard", + "build": { "libArchive": false}, "dependencies": { "WireGuard-ESP32-Arduino":"https://github.com/kienvu58/WireGuard-ESP32-Arduino.git" } diff --git a/usermods/wizlights/library.json b/usermods/wizlights/library.json index 687fba0f..38ea759f 100644 --- a/usermods/wizlights/library.json +++ b/usermods/wizlights/library.json @@ -1,3 +1,4 @@ { - "name:": "wizlights" + "name:": "wizlights", + "build": { "libArchive": false } } \ No newline at end of file diff --git a/usermods/word-clock-matrix/library.json b/usermods/word-clock-matrix/library.json index d971dfff..12a8bd7f 100644 --- a/usermods/word-clock-matrix/library.json +++ b/usermods/word-clock-matrix/library.json @@ -1,3 +1,4 @@ { - "name:": "word-clock-matrix" + "name:": "word-clock-matrix", + "build": { "libArchive": false } } \ No newline at end of file From 1dbd7066decf914398d30a092e34625c4cc8b178 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 14 Jan 2025 00:27:54 +0000 Subject: [PATCH 23/64] Revert LOROL_LITTLEFS hack --- wled00/wled.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/wled00/wled.h b/wled00/wled.h index 5a1a9ff8..ae93d954 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -1,6 +1,3 @@ -// TODO: HACK!! - do not merge -#define LOROL_LITTLEFS 1 - #ifndef WLED_H #define WLED_H /* From e4714870a406674fbe18280a2306a27fc793d00b Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 14 Jan 2025 00:39:04 +0000 Subject: [PATCH 24/64] typo in usermods/sensors_to_mqtt/library.json --- usermods/sensors_to_mqtt/library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index 29addddc..91118c23 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -4,5 +4,5 @@ "dependencies": { "adafruit/Adafruit BMP280 Library":"2.1.0", "adafruit/Adafruit CCS811 Library":"1.0.4", - "adafruit/Adafruit Si7021 Library":"1.4.0 + "adafruit/Adafruit Si7021 Library":"1.4.0" } From 869e275e48e3bb1bd0fce020c9cfcdbd8d5535b3 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 14 Jan 2025 00:43:59 +0000 Subject: [PATCH 25/64] typo in usermods/sensors_to_mqtt/library.json --- usermods/sensors_to_mqtt/library.json | 1 + 1 file changed, 1 insertion(+) diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index 91118c23..9ce4424e 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -5,4 +5,5 @@ "adafruit/Adafruit BMP280 Library":"2.1.0", "adafruit/Adafruit CCS811 Library":"1.0.4", "adafruit/Adafruit Si7021 Library":"1.4.0" + } } From 0b8721c25e635e2b6149455ef63d3d54c20be0d3 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Mon, 13 Jan 2025 21:26:15 -0500 Subject: [PATCH 26/64] Fix usermod libArchive setting Monkey-patch PlatformIO to intercept the build process after library dependencies are loaded, but before the build is fully analyzed. This lets us enforce libArchive=False for usermods without making that setting global across all libraries. The rest of the fixup code is integrated at the same call site for simplicity. --- pio-scripts/fixup_usermods.py | 17 -------------- pio-scripts/load_usermods.py | 44 +++++++++++++++++++++++++++++------ platformio.ini | 1 - 3 files changed, 37 insertions(+), 25 deletions(-) delete mode 100644 pio-scripts/fixup_usermods.py diff --git a/pio-scripts/fixup_usermods.py b/pio-scripts/fixup_usermods.py deleted file mode 100644 index 5b8cddf3..00000000 --- a/pio-scripts/fixup_usermods.py +++ /dev/null @@ -1,17 +0,0 @@ -Import('env') - -# Patch up each usermod's include folders to include anything referenced by wled -# This is because usermods need to include wled.h -lib_builders = env.GetLibBuilders() -um_deps = [dep for dep in lib_builders if "/usermods" in dep.src_dir] -other_deps = [dep for dep in lib_builders if "/usermods" not in dep.src_dir] - -for um in um_deps: - # Add include paths for all non-usermod dependencies - for dep in other_deps: - for dir in dep.get_include_dirs(): - um.env.PrependUnique(CPPPATH=dir) - # Add the wled folder to the include path - um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"]) - -#raise RuntimeError("debug") diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index 55b9c4b1..f5307820 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -1,17 +1,19 @@ Import('env') -import os +from pathlib import Path # For OS-agnostic path manipulation -def find_usermod(mod_dir: str, mod: str): +usermod_dir = Path(env["PROJECT_DIR"]) / "usermods" + +def find_usermod(mod: str): """Locate this library in the usermods folder. We do this to avoid needing to rename a bunch of folders; this could be removed later """ # Check name match - mp = f"{mod_dir}/{mod}" - if os.path.exists(mp): + mp = usermod_dir / mod + if mp.exists(): return mp - mp = f"{mod_dir}/usermod_v2_{mod}" - if os.path.exists(mp): + mp = usermod_dir / f"usermod_v2_{mod}" + if mp.exists(): return mp raise RuntimeError(f"Couldn't locate module {mod} in usermods directory!") @@ -21,6 +23,34 @@ if usermods: deps = env.GetProjectOption('lib_deps') src_dir = proj.get("platformio", "src_dir") src_dir = src_dir.replace('\\','/') - mod_paths = {mod: find_usermod(f"{src_dir}/../usermods", mod) for mod in usermods.split(" ")} + mod_paths = {mod: find_usermod(mod) for mod in usermods.split(" ")} usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()] proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) + + +# Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies +# Save the old value +cpl = env.ConfigureProjectLibBuilder +# Our new wrapper +def cpl_wrapper(env): + result = cpl.clone(env)() + # Update usermod properties + lib_builders = env.GetLibBuilders() + um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents] + other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents] + for um in um_deps: + # Add include paths for all non-usermod dependencies + for dep in other_deps: + for dir in dep.get_include_dirs(): + um.env.PrependUnique(CPPPATH=dir) + # Add the wled folder to the include path + um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"]) + # Make sure we link directly, not through an archive + # Archives drop the .dtor table section we need + build = um._manifest.get("build", {}) + build["libArchive"] = False + um._manifest["build"] = build + return result + +# Replace the old one with ours +env.AddMethod(cpl_wrapper, "ConfigureProjectLibBuilder") diff --git a/platformio.ini b/platformio.ini index a64295e5..93219d2f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -115,7 +115,6 @@ extra_scripts = post:pio-scripts/strip-floats.py pre:pio-scripts/user_config_copy.py pre:pio-scripts/load_usermods.py - post:pio-scripts/fixup_usermods.py pre:pio-scripts/build_ui.py ; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging) From 270d75afe2b7ee624f10546f32877fbe0a062a18 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Tue, 14 Jan 2025 22:16:55 +0000 Subject: [PATCH 27/64] Update usermod deps earlier When processing usermods, update their include path properties before the LDF runs, so it can see through wled.h. --- pio-scripts/load_usermods.py | 112 +++++++++++++++++------------------ 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index f5307820..81cbc7bf 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -1,56 +1,56 @@ -Import('env') -from pathlib import Path # For OS-agnostic path manipulation - -usermod_dir = Path(env["PROJECT_DIR"]) / "usermods" - -def find_usermod(mod: str): - """Locate this library in the usermods folder. - We do this to avoid needing to rename a bunch of folders; - this could be removed later - """ - # Check name match - mp = usermod_dir / mod - if mp.exists(): - return mp - mp = usermod_dir / f"usermod_v2_{mod}" - if mp.exists(): - return mp - raise RuntimeError(f"Couldn't locate module {mod} in usermods directory!") - -usermods = env.GetProjectOption("custom_usermods","") -if usermods: - proj = env.GetProjectConfig() - deps = env.GetProjectOption('lib_deps') - src_dir = proj.get("platformio", "src_dir") - src_dir = src_dir.replace('\\','/') - mod_paths = {mod: find_usermod(mod) for mod in usermods.split(" ")} - usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()] - proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) - - -# Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies -# Save the old value -cpl = env.ConfigureProjectLibBuilder -# Our new wrapper -def cpl_wrapper(env): - result = cpl.clone(env)() - # Update usermod properties - lib_builders = env.GetLibBuilders() - um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents] - other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents] - for um in um_deps: - # Add include paths for all non-usermod dependencies - for dep in other_deps: - for dir in dep.get_include_dirs(): - um.env.PrependUnique(CPPPATH=dir) - # Add the wled folder to the include path - um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"]) - # Make sure we link directly, not through an archive - # Archives drop the .dtor table section we need - build = um._manifest.get("build", {}) - build["libArchive"] = False - um._manifest["build"] = build - return result - -# Replace the old one with ours -env.AddMethod(cpl_wrapper, "ConfigureProjectLibBuilder") +Import('env') +from pathlib import Path # For OS-agnostic path manipulation + +usermod_dir = Path(env["PROJECT_DIR"]) / "usermods" + +def find_usermod(mod: str): + """Locate this library in the usermods folder. + We do this to avoid needing to rename a bunch of folders; + this could be removed later + """ + # Check name match + mp = usermod_dir / mod + if mp.exists(): + return mp + mp = usermod_dir / f"usermod_v2_{mod}" + if mp.exists(): + return mp + raise RuntimeError(f"Couldn't locate module {mod} in usermods directory!") + +usermods = env.GetProjectOption("custom_usermods","") +if usermods: + proj = env.GetProjectConfig() + deps = env.GetProjectOption('lib_deps') + src_dir = proj.get("platformio", "src_dir") + src_dir = src_dir.replace('\\','/') + mod_paths = {mod: find_usermod(mod) for mod in usermods.split(" ")} + usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()] + proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) + + +# Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies +# Save the old value +cpl = env.ConfigureProjectLibBuilder +# Our new wrapper +def cpl_wrapper(env): + # Update usermod properties + lib_builders = env.GetLibBuilders() + um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents] + other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents] + for um in um_deps: + # Add include paths for all non-usermod dependencies + for dep in other_deps: + for dir in dep.get_include_dirs(): + um.env.PrependUnique(CPPPATH=dir) + # Add the wled folder to the include path + um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"]) + # Make sure we link directly, not through an archive + # Archives drop the .dtor table section we need + build = um._manifest.get("build", {}) + build["libArchive"] = False + um._manifest["build"] = build + return cpl.clone(env)() + + +# Replace the old one with ours +env.AddMethod(cpl_wrapper, "ConfigureProjectLibBuilder") From 8fd905215f4734616d31c8ba0755ada097b91d99 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Tue, 14 Jan 2025 22:21:26 +0000 Subject: [PATCH 28/64] Integrate usermods environment Move the "all usermods" logic in to the platformio script, so the 'usermods' environment can be built in any checkout without extra setup commands. --- .github/workflows/build.yml | 5 ----- pio-scripts/load_usermods.py | 5 +++++ platformio.ini | 1 + usermods/platformio_override.usermods.ini | 9 --------- 4 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 usermods/platformio_override.usermods.ini diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efdb3f7a..3de08ff7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,11 +57,6 @@ jobs: 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 -n "custom_usermods = " >> platformio_override.ini - find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo >> platformio_override.ini - name: Build firmware run: pio run -e ${{ matrix.environment }} diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index 81cbc7bf..76359a7a 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -2,6 +2,11 @@ Import('env') from pathlib import Path # For OS-agnostic path manipulation usermod_dir = Path(env["PROJECT_DIR"]) / "usermods" +all_usermods = [f for f in usermod_dir.iterdir() if f.is_dir() and f.joinpath('library.json').exists()] + +if env['PIOENV'] == "usermods": + # Add all usermods + env.GetProjectConfig().set(f"env:usermods", 'custom_usermods', " ".join([f.name for f in all_usermods])) def find_usermod(mod: str): """Locate this library in the usermods folder. diff --git a/platformio.ini b/platformio.ini index 93219d2f..57919e2d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -632,3 +632,4 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" ${esp32.AR_build_flags} lib_deps = ${esp32.lib_deps} +board_build.partitions = ${esp32.big_partitions} diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini deleted file mode 100644 index 3b3e6696..00000000 --- a/usermods/platformio_override.usermods.ini +++ /dev/null @@ -1,9 +0,0 @@ -[env:usermods] -board = esp32dev -platform = ${esp32.platform} -platform_packages = ${esp32.platform_packages} -build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" - ${esp32.AR_build_flags} -lib_deps = ${esp32.lib_deps} -board_build.partitions = ${esp32.big_partitions} From 30559cd2d3a1478708f998de257ccb29d5eeb3d1 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Tue, 14 Jan 2025 22:21:41 +0000 Subject: [PATCH 29/64] Fix dependency for EleksTube_IPS usermod --- usermods/EleksTube_IPS/library.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usermods/EleksTube_IPS/library.json b/usermods/EleksTube_IPS/library.json index e5ed6219..0fc259af 100644 --- a/usermods/EleksTube_IPS/library.json +++ b/usermods/EleksTube_IPS/library.json @@ -1,4 +1,7 @@ { "name:": "EleksTube_IPS", - "build": { "libArchive": false } -} \ No newline at end of file + "build": { "libArchive": false }, + "dependencies": { + "TFT_eSPI" : "2.5.33" + } +} From 32607ee74c280d741f2d0a56b96c3f31df7c7c0e Mon Sep 17 00:00:00 2001 From: Will Miles Date: Wed, 15 Jan 2025 02:26:26 +0000 Subject: [PATCH 30/64] Revert incorrect testing platformio.ini --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 57919e2d..8d8e7647 100644 --- a/platformio.ini +++ b/platformio.ini @@ -417,7 +417,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME= board = esp32dev platform = ${esp32.platform} platform_packages = ${esp32.platform_packages} -custom_usermods = audioreactive auto_save animartrix +custom_usermods = audioreactive build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET lib_deps = ${esp32.lib_deps} From 2adf745d06e031b763fcf9505ed42ef540d0db24 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 15 Jan 2025 11:22:33 +0000 Subject: [PATCH 31/64] Update env:usermods to use V4 --- platformio.ini | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/platformio.ini b/platformio.ini index dad7007f..5cddbbf9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -427,7 +427,6 @@ board = esp32dev platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_V4\" #-D WLED_DISABLE_BROWNOUT_DET - ${esp32.AR_build_flags} lib_deps = ${esp32_idf_V4.lib_deps} ${esp32.AR_lib_deps} monitor_filters = esp32_exception_decoder @@ -628,10 +627,10 @@ lib_deps = ${esp32s2.lib_deps} [env:usermods] board = esp32dev -platform = ${esp32.platform} -platform_packages = ${esp32.platform_packages} +platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\" - ${esp32.AR_build_flags} -lib_deps = ${esp32.lib_deps} +build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\" +lib_deps = ${esp32_idf_V4.lib_deps} +monitor_filters = esp32_exception_decoder +board_build.flash_mode = dio board_build.partitions = ${esp32.big_partitions} From 5da380e1b0cda1d44e2d246e097eff4838ed67d5 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 15 Jan 2025 11:28:38 +0000 Subject: [PATCH 32/64] Update dependencies for sensors_to_mqtt --- usermods/sensors_to_mqtt/library.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index 9ce4424e..731f57b2 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -2,8 +2,8 @@ "name:": "sensors_to_mqtt", "build": { "libArchive": false}, "dependencies": { - "adafruit/Adafruit BMP280 Library":"2.1.0", - "adafruit/Adafruit CCS811 Library":"1.0.4", - "adafruit/Adafruit Si7021 Library":"1.4.0" + "adafruit/Adafruit BMP280 Library":"2.6.8", + "adafruit/Adafruit CCS811 Library":"1.1.3", + "adafruit/Adafruit Si7021 Library":"1.5.3" } } From 59a79a30da2dd32b261242046db85debd5fac4b6 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 15 Jan 2025 11:34:51 +0000 Subject: [PATCH 33/64] Add deps for usermods/BME280_v2 --- usermods/BME280_v2/library.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usermods/BME280_v2/library.json b/usermods/BME280_v2/library.json index faae0f34..1cb805d3 100644 --- a/usermods/BME280_v2/library.json +++ b/usermods/BME280_v2/library.json @@ -1,4 +1,7 @@ { "name:": "BME280_v2", - "build": { "libArchive": false } + "build": { "libArchive": false }, + "dependencies": { + "finitespace/BME280":"~3.0.0" + } } \ No newline at end of file From 0afd2fe720c5981cd38b9d90d4bb7187ab8fcdb0 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 15 Jan 2025 12:46:06 +0000 Subject: [PATCH 34/64] Destructor must be public --- usermods/AHT10_v2/AHT10_v2.cpp | 12 ++++++------ usermods/INA226_v2/INA226_v2.cpp | 13 +++++++------ usermods/mqtt_switch_v2/mqtt_switch_v2.cpp | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/usermods/AHT10_v2/AHT10_v2.cpp b/usermods/AHT10_v2/AHT10_v2.cpp index 171e1575..a5d30c0e 100644 --- a/usermods/AHT10_v2/AHT10_v2.cpp +++ b/usermods/AHT10_v2/AHT10_v2.cpp @@ -54,12 +54,6 @@ private: _lastTemperature = 0; } - ~UsermodAHT10() - { - delete _aht; - _aht = nullptr; - } - #ifndef WLED_DISABLE_MQTT void mqttInitialize() { @@ -322,6 +316,12 @@ public: _initDone = true; return configComplete; } + + ~UsermodAHT10() + { + delete _aht; + _aht = nullptr; + } }; const char UsermodAHT10::_name[] PROGMEM = "AHTxx"; diff --git a/usermods/INA226_v2/INA226_v2.cpp b/usermods/INA226_v2/INA226_v2.cpp index 3c79f05b..0284a6fa 100644 --- a/usermods/INA226_v2/INA226_v2.cpp +++ b/usermods/INA226_v2/INA226_v2.cpp @@ -210,12 +210,6 @@ private: } } - ~UsermodINA226() - { - delete _ina226; - _ina226 = nullptr; - } - #ifndef WLED_DISABLE_MQTT void mqttInitialize() { @@ -551,6 +545,13 @@ public: _initDone = true; return configComplete; } + + ~UsermodINA226() + { + delete _ina226; + _ina226 = nullptr; + } + }; const char UsermodINA226::_name[] PROGMEM = "INA226"; diff --git a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp index d4d823f3..9c8dd5f0 100644 --- a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp +++ b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp @@ -159,5 +159,5 @@ inline void UsermodMqttSwitch::updateState(uint8_t pinNr) } -static UsermodMqttSwitc mqtt_switch_v2; +static UsermodMqttSwitch mqtt_switch_v2; REGISTER_USERMOD(mqtt_switch_v2); \ No newline at end of file From 5d05d7936c238a446ff2b9c76e3f0aa1cf089936 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 15 Jan 2025 12:46:48 +0000 Subject: [PATCH 35/64] Add usermod dependencies --- usermods/LD2410_v2/library.json | 5 ++++- usermods/Si7021_MQTT_HA/library.json | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/usermods/LD2410_v2/library.json b/usermods/LD2410_v2/library.json index faef37d4..60d493ad 100644 --- a/usermods/LD2410_v2/library.json +++ b/usermods/LD2410_v2/library.json @@ -1,4 +1,7 @@ { "name:": "LD2410_v2", - "build": { "libArchive": false } + "build": { "libArchive": false }, + "dependencies": { + "ncmreynolds/ld2410":"^0.1.3" + } } \ No newline at end of file diff --git a/usermods/Si7021_MQTT_HA/library.json b/usermods/Si7021_MQTT_HA/library.json index 60991a3e..8294c126 100644 --- a/usermods/Si7021_MQTT_HA/library.json +++ b/usermods/Si7021_MQTT_HA/library.json @@ -1,4 +1,7 @@ { "name:": "Si7021_MQTT_HA", - "build": { "libArchive": false } + "build": { "libArchive": false }, + "dependencies": { + "finitespace/BME280":"3.0.0" + } } \ No newline at end of file From 8487dd7cfd48eda4450ac3bfa54405e0a964bd17 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 15 Jan 2025 12:49:40 +0000 Subject: [PATCH 36/64] Disable build of usermods that are broken at the moment --- usermods/BME280_v2/{library.json => library.json.disabled} | 0 usermods/BME68X_v2/{library.json => library.json.disabled} | 0 usermods/MAX17048_v2/{library.json => library.json.disabled} | 0 usermods/MY9291/{library.json => library.json.disabled} | 0 usermods/RTC/{library.json => library.json.disabled} | 0 usermods/ST7789_display/{library.json => library.json.disabled} | 0 usermods/pov_display/{library.json => library.json.disabled} | 0 .../rgb-rotary-encoder/{library.json => library.json.disabled} | 0 usermods/sht/{library.json => library.json.disabled} | 0 .../{library.json => library.json.disabled} | 0 .../{library.json => library.json.disabled} | 0 .../word-clock-matrix/{library.json => library.json.disabled} | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename usermods/BME280_v2/{library.json => library.json.disabled} (100%) rename usermods/BME68X_v2/{library.json => library.json.disabled} (100%) rename usermods/MAX17048_v2/{library.json => library.json.disabled} (100%) rename usermods/MY9291/{library.json => library.json.disabled} (100%) rename usermods/RTC/{library.json => library.json.disabled} (100%) rename usermods/ST7789_display/{library.json => library.json.disabled} (100%) rename usermods/pov_display/{library.json => library.json.disabled} (100%) rename usermods/rgb-rotary-encoder/{library.json => library.json.disabled} (100%) rename usermods/sht/{library.json => library.json.disabled} (100%) rename usermods/usermod_v2_HttpPullLightControl/{library.json => library.json.disabled} (100%) rename usermods/usermod_v2_four_line_display_ALT/{library.json => library.json.disabled} (100%) rename usermods/word-clock-matrix/{library.json => library.json.disabled} (100%) diff --git a/usermods/BME280_v2/library.json b/usermods/BME280_v2/library.json.disabled similarity index 100% rename from usermods/BME280_v2/library.json rename to usermods/BME280_v2/library.json.disabled diff --git a/usermods/BME68X_v2/library.json b/usermods/BME68X_v2/library.json.disabled similarity index 100% rename from usermods/BME68X_v2/library.json rename to usermods/BME68X_v2/library.json.disabled diff --git a/usermods/MAX17048_v2/library.json b/usermods/MAX17048_v2/library.json.disabled similarity index 100% rename from usermods/MAX17048_v2/library.json rename to usermods/MAX17048_v2/library.json.disabled diff --git a/usermods/MY9291/library.json b/usermods/MY9291/library.json.disabled similarity index 100% rename from usermods/MY9291/library.json rename to usermods/MY9291/library.json.disabled diff --git a/usermods/RTC/library.json b/usermods/RTC/library.json.disabled similarity index 100% rename from usermods/RTC/library.json rename to usermods/RTC/library.json.disabled diff --git a/usermods/ST7789_display/library.json b/usermods/ST7789_display/library.json.disabled similarity index 100% rename from usermods/ST7789_display/library.json rename to usermods/ST7789_display/library.json.disabled diff --git a/usermods/pov_display/library.json b/usermods/pov_display/library.json.disabled similarity index 100% rename from usermods/pov_display/library.json rename to usermods/pov_display/library.json.disabled diff --git a/usermods/rgb-rotary-encoder/library.json b/usermods/rgb-rotary-encoder/library.json.disabled similarity index 100% rename from usermods/rgb-rotary-encoder/library.json rename to usermods/rgb-rotary-encoder/library.json.disabled diff --git a/usermods/sht/library.json b/usermods/sht/library.json.disabled similarity index 100% rename from usermods/sht/library.json rename to usermods/sht/library.json.disabled diff --git a/usermods/usermod_v2_HttpPullLightControl/library.json b/usermods/usermod_v2_HttpPullLightControl/library.json.disabled similarity index 100% rename from usermods/usermod_v2_HttpPullLightControl/library.json rename to usermods/usermod_v2_HttpPullLightControl/library.json.disabled diff --git a/usermods/usermod_v2_four_line_display_ALT/library.json b/usermods/usermod_v2_four_line_display_ALT/library.json.disabled similarity index 100% rename from usermods/usermod_v2_four_line_display_ALT/library.json rename to usermods/usermod_v2_four_line_display_ALT/library.json.disabled diff --git a/usermods/word-clock-matrix/library.json b/usermods/word-clock-matrix/library.json.disabled similarity index 100% rename from usermods/word-clock-matrix/library.json rename to usermods/word-clock-matrix/library.json.disabled From 15edfcd0881de91db4e4c07bee4bdbf9bd37bc45 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Thu, 16 Jan 2025 01:05:12 +0000 Subject: [PATCH 37/64] Fix usermod platformio integration Should now work for new *and* old versions of PlatformIO! --- pio-scripts/load_usermods.py | 72 ++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index 76359a7a..7aa6c4d8 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -1,5 +1,7 @@ Import('env') +import os.path from pathlib import Path # For OS-agnostic path manipulation +from platformio.package.manager.library import LibraryPackageManager usermod_dir = Path(env["PROJECT_DIR"]) / "usermods" all_usermods = [f for f in usermod_dir.iterdir() if f.is_dir() and f.joinpath('library.json').exists()] @@ -24,38 +26,70 @@ def find_usermod(mod: str): usermods = env.GetProjectOption("custom_usermods","") if usermods: + # Inject usermods in to project lib_deps proj = env.GetProjectConfig() - deps = env.GetProjectOption('lib_deps') + deps = env.GetProjectOption('lib_deps') src_dir = proj.get("platformio", "src_dir") src_dir = src_dir.replace('\\','/') mod_paths = {mod: find_usermod(mod) for mod in usermods.split(" ")} usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()] - proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) + proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) + # Force usermods to be installed in to the environment build state before the LDF runs + # Otherwise we won't be able to see them until it's too late to change their paths for LDF + # Logic is largely borrowed from PlaformIO internals + not_found_specs = [] + for spec in usermods: + found = False + for storage_dir in env.GetLibSourceDirs(): + #print(f"Checking {storage_dir} for {spec}") + lm = LibraryPackageManager(storage_dir) + if lm.get_package(spec): + #print("Found!") + found = True + break + if not found: + #print("Missing!") + not_found_specs.append(spec) + if not_found_specs: + lm = LibraryPackageManager( + env.subst(os.path.join("$PROJECT_LIBDEPS_DIR", "$PIOENV")) + ) + for spec in not_found_specs: + #print(f"LU: forcing install of {spec}") + lm.install(spec) # Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies # Save the old value -cpl = env.ConfigureProjectLibBuilder +old_ConfigureProjectLibBuilder = env.ConfigureProjectLibBuilder + # Our new wrapper -def cpl_wrapper(env): +def wrapped_ConfigureProjectLibBuilder(xenv): # Update usermod properties - lib_builders = env.GetLibBuilders() - um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents] - other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents] - for um in um_deps: - # Add include paths for all non-usermod dependencies - for dep in other_deps: - for dir in dep.get_include_dirs(): - um.env.PrependUnique(CPPPATH=dir) - # Add the wled folder to the include path - um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"]) - # Make sure we link directly, not through an archive - # Archives drop the .dtor table section we need + # Set libArchive before build actions are added + for um in (um for um in xenv.GetLibBuilders() if usermod_dir in Path(um.src_dir).parents): build = um._manifest.get("build", {}) build["libArchive"] = False um._manifest["build"] = build - return cpl.clone(env)() + # Call the wrapped function + result = old_ConfigureProjectLibBuilder.clone(xenv)() -# Replace the old one with ours -env.AddMethod(cpl_wrapper, "ConfigureProjectLibBuilder") + # Fix up include paths + # In PlatformIO >=6.1.17, this could be done prior to ConfigureProjectLibBuilder + wled_dir = xenv["PROJECT_SRC_DIR"] + lib_builders = xenv.GetLibBuilders() + um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents] + other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents] + for um in um_deps: + # Add the wled folder to the include path + um.env.PrependUnique(CPPPATH=wled_dir) + # Add WLED's own dependencies + for dep in other_deps: + for dir in dep.get_include_dirs(): + um.env.PrependUnique(CPPPATH=dir) + + return result + +# Apply the wrapper +env.AddMethod(wrapped_ConfigureProjectLibBuilder, "ConfigureProjectLibBuilder") From 193926c795961bf30de3c5f44d19ffeb13c4c9d9 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 17 Jan 2025 00:50:02 +0000 Subject: [PATCH 38/64] usermods: Remove #pragma once from cpps --- usermods/ADS1115_v2/ADS1115_v2.cpp | 2 -- usermods/AHT10_v2/AHT10_v2.cpp | 2 -- usermods/Analog_Clock/Analog_Clock.cpp | 1 - usermods/Animated_Staircase/Animated_Staircase.cpp | 1 - usermods/BH1750_v2/BH1750_v2.cpp | 2 -- usermods/BME280_v2/BME280_v2.cpp | 2 -- usermods/BME68X_v2/BME68X_v2.cpp | 1 - usermods/Battery/Battery.cpp | 2 -- usermods/Cronixie/Cronixie.cpp | 2 -- usermods/DHT/DHT.cpp | 2 -- usermods/EleksTube_IPS/EleksTube_IPS.cpp | 1 - usermods/INA226_v2/INA226_v2.cpp | 2 -- .../Internal_Temperature_v2/Internal_Temperature_v2.cpp | 2 -- usermods/LD2410_v2/LD2410_v2.cpp | 2 -- usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp | 1 - usermods/MAX17048_v2/MAX17048_v2.cpp | 2 -- usermods/MY9291/MY9291.cpp | 2 -- usermods/PIR_sensor_switch/PIR_sensor_switch.cpp | 8 +++----- usermods/PWM_fan/PWM_fan.cpp | 2 -- usermods/RTC/RTC.cpp | 2 -- usermods/SN_Photoresistor/SN_Photoresistor.cpp | 2 -- usermods/ST7789_display/ST7789_display.cpp | 2 -- usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp | 2 -- usermods/Temperature/Temperature.cpp | 2 -- usermods/TetrisAI_v2/TetrisAI_v2.cpp | 2 -- usermods/VL53L0X_gestures/VL53L0X_gestures.cpp | 2 -- usermods/boblight/boblight.cpp | 2 -- usermods/buzzer/buzzer.cpp | 2 -- usermods/deep_sleep/deep_sleep.cpp | 2 -- usermods/mpu6050_imu/mpu6050_imu.cpp | 2 -- usermods/mqtt_switch_v2/mqtt_switch_v2.cpp | 2 -- usermods/multi_relay/multi_relay.cpp | 2 -- usermods/pixels_dice_tray/pixels_dice_tray.cpp | 2 -- usermods/pov_display/pov_display.cpp | 1 - usermods/pwm_outputs/pwm_outputs.cpp | 1 - usermods/quinled-an-penta/quinled-an-penta.cpp | 2 -- usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp | 2 -- usermods/sd_card/sd_card.cpp | 2 -- usermods/sensors_to_mqtt/sensors_to_mqtt.cpp | 2 -- usermods/seven_segment_display/seven_segment_display.cpp | 2 -- .../seven_segment_display_reloaded.cpp | 2 -- usermods/sht/sht.cpp | 2 -- usermods/smartnest/smartnest.cpp | 2 -- .../usermod_rotary_brightness_color.cpp | 2 -- usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp | 2 -- .../usermod_v2_four_line_display_ALT.cpp | 2 -- .../usermod_v2_klipper_percentage.cpp | 2 -- .../usermod_v2_ping_pong_clock.cpp | 2 -- .../usermod_v2_rotary_encoder_ui_ALT.cpp | 2 -- usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp | 2 -- usermods/wireguard/wireguard.cpp | 2 -- usermods/wizlights/wizlights.cpp | 2 -- usermods/word-clock-matrix/word-clock-matrix.cpp | 2 -- 53 files changed, 3 insertions(+), 102 deletions(-) diff --git a/usermods/ADS1115_v2/ADS1115_v2.cpp b/usermods/ADS1115_v2/ADS1115_v2.cpp index 48f91733..bbf457f4 100644 --- a/usermods/ADS1115_v2/ADS1115_v2.cpp +++ b/usermods/ADS1115_v2/ADS1115_v2.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include #include diff --git a/usermods/AHT10_v2/AHT10_v2.cpp b/usermods/AHT10_v2/AHT10_v2.cpp index a5d30c0e..f88bee1d 100644 --- a/usermods/AHT10_v2/AHT10_v2.cpp +++ b/usermods/AHT10_v2/AHT10_v2.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include diff --git a/usermods/Analog_Clock/Analog_Clock.cpp b/usermods/Analog_Clock/Analog_Clock.cpp index 8a4c048a..970ba722 100644 --- a/usermods/Analog_Clock/Analog_Clock.cpp +++ b/usermods/Analog_Clock/Analog_Clock.cpp @@ -1,4 +1,3 @@ -#pragma once #include "wled.h" /* diff --git a/usermods/Animated_Staircase/Animated_Staircase.cpp b/usermods/Animated_Staircase/Animated_Staircase.cpp index 43d9db6b..2d2d27cf 100644 --- a/usermods/Animated_Staircase/Animated_Staircase.cpp +++ b/usermods/Animated_Staircase/Animated_Staircase.cpp @@ -7,7 +7,6 @@ * * See the accompanying README.md file for more info. */ -#pragma once #include "wled.h" class Animated_Staircase : public Usermod { diff --git a/usermods/BH1750_v2/BH1750_v2.cpp b/usermods/BH1750_v2/BH1750_v2.cpp index 5bd47624..ec29f5b9 100644 --- a/usermods/BH1750_v2/BH1750_v2.cpp +++ b/usermods/BH1750_v2/BH1750_v2.cpp @@ -5,8 +5,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" #include diff --git a/usermods/BME280_v2/BME280_v2.cpp b/usermods/BME280_v2/BME280_v2.cpp index d29451ee..8cc986aa 100644 --- a/usermods/BME280_v2/BME280_v2.cpp +++ b/usermods/BME280_v2/BME280_v2.cpp @@ -5,8 +5,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" #include #include // BME280 sensor diff --git a/usermods/BME68X_v2/BME68X_v2.cpp b/usermods/BME68X_v2/BME68X_v2.cpp index 5814506b..081d03ff 100644 --- a/usermods/BME68X_v2/BME68X_v2.cpp +++ b/usermods/BME68X_v2/BME68X_v2.cpp @@ -6,7 +6,6 @@ * @date 19 Feb 2024 */ -#pragma once #warning ********************Included USERMOD_BME68X ******************** #define UMOD_DEVICE "ESP32" // NOTE - Set your hardware here diff --git a/usermods/Battery/Battery.cpp b/usermods/Battery/Battery.cpp index 4646a238..5572f550 100644 --- a/usermods/Battery/Battery.cpp +++ b/usermods/Battery/Battery.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include "battery_defaults.h" #include "UMBattery.h" diff --git a/usermods/Cronixie/Cronixie.cpp b/usermods/Cronixie/Cronixie.cpp index 09e7e25a..05557de0 100644 --- a/usermods/Cronixie/Cronixie.cpp +++ b/usermods/Cronixie/Cronixie.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" class UsermodCronixie : public Usermod { diff --git a/usermods/DHT/DHT.cpp b/usermods/DHT/DHT.cpp index fad6dad5..0b481064 100644 --- a/usermods/DHT/DHT.cpp +++ b/usermods/DHT/DHT.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #ifndef WLED_ENABLE_MQTT #error "This user mod requires MQTT to be enabled." diff --git a/usermods/EleksTube_IPS/EleksTube_IPS.cpp b/usermods/EleksTube_IPS/EleksTube_IPS.cpp index 48fbb2b4..e8637b0f 100644 --- a/usermods/EleksTube_IPS/EleksTube_IPS.cpp +++ b/usermods/EleksTube_IPS/EleksTube_IPS.cpp @@ -1,4 +1,3 @@ -#pragma once #include "TFTs.h" #include "wled.h" diff --git a/usermods/INA226_v2/INA226_v2.cpp b/usermods/INA226_v2/INA226_v2.cpp index 0284a6fa..26f92f49 100644 --- a/usermods/INA226_v2/INA226_v2.cpp +++ b/usermods/INA226_v2/INA226_v2.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include diff --git a/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp index ab7f907e..7c30985e 100644 --- a/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp +++ b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" class InternalTemperatureUsermod : public Usermod diff --git a/usermods/LD2410_v2/LD2410_v2.cpp b/usermods/LD2410_v2/LD2410_v2.cpp index 51c887fa..7c1c3674 100644 --- a/usermods/LD2410_v2/LD2410_v2.cpp +++ b/usermods/LD2410_v2/LD2410_v2.cpp @@ -4,8 +4,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" #include diff --git a/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp b/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp index 6104fcab..9c5c835e 100644 --- a/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp +++ b/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp @@ -1,4 +1,3 @@ -#pragma once #include "wled.h" #ifndef ARDUINO_ARCH_ESP32 diff --git a/usermods/MAX17048_v2/MAX17048_v2.cpp b/usermods/MAX17048_v2/MAX17048_v2.cpp index 1a1108cf..c284bca7 100644 --- a/usermods/MAX17048_v2/MAX17048_v2.cpp +++ b/usermods/MAX17048_v2/MAX17048_v2.cpp @@ -1,8 +1,6 @@ // force the compiler to show a warning to confirm that this file is included #warning **** Included USERMOD_MAX17048 V2.0 **** -#pragma once - #include "wled.h" #include "Adafruit_MAX1704X.h" diff --git a/usermods/MY9291/MY9291.cpp b/usermods/MY9291/MY9291.cpp index ce8d0f00..3881ffd0 100644 --- a/usermods/MY9291/MY9291.cpp +++ b/usermods/MY9291/MY9291.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include "MY92xx.h" diff --git a/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp b/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp index 1cc31a08..20e4bc14 100644 --- a/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp +++ b/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #ifndef PIR_SENSOR_PIN @@ -571,7 +569,7 @@ bool PIRsensorSwitch::readFromConfig(JsonObject &root) // use "return !top["newestParameter"].isNull();" when updating Usermod with new features return !(pins.isNull() || pins.size() != PIR_SENSOR_MAX_SENSORS); } - - -static PIRsensorSwitch pir_sensor_switch; + + +static PIRsensorSwitch pir_sensor_switch; REGISTER_USERMOD(pir_sensor_switch); \ No newline at end of file diff --git a/usermods/PWM_fan/PWM_fan.cpp b/usermods/PWM_fan/PWM_fan.cpp index 9df37304..a89a1f32 100644 --- a/usermods/PWM_fan/PWM_fan.cpp +++ b/usermods/PWM_fan/PWM_fan.cpp @@ -1,5 +1,3 @@ -#pragma once - #if !defined(USERMOD_DALLASTEMPERATURE) && !defined(USERMOD_SHT) #error The "PWM fan" usermod requires "Dallas Temeprature" or "SHT" usermod to function properly. #endif diff --git a/usermods/RTC/RTC.cpp b/usermods/RTC/RTC.cpp index f9dbe3cf..2b9c3b4f 100644 --- a/usermods/RTC/RTC.cpp +++ b/usermods/RTC/RTC.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "src/dependencies/time/DS1307RTC.h" #include "wled.h" diff --git a/usermods/SN_Photoresistor/SN_Photoresistor.cpp b/usermods/SN_Photoresistor/SN_Photoresistor.cpp index 5e50ab7a..97f865a9 100644 --- a/usermods/SN_Photoresistor/SN_Photoresistor.cpp +++ b/usermods/SN_Photoresistor/SN_Photoresistor.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" //Pin defaults for QuinLed Dig-Uno (A0) diff --git a/usermods/ST7789_display/ST7789_display.cpp b/usermods/ST7789_display/ST7789_display.cpp index e81c53ba..c596baec 100644 --- a/usermods/ST7789_display/ST7789_display.cpp +++ b/usermods/ST7789_display/ST7789_display.cpp @@ -1,8 +1,6 @@ // Credits to @mrVanboy, @gwaland and my dearest friend @westward // Also for @spiff72 for usermod TTGO-T-Display // 210217 -#pragma once - #include "wled.h" #include #include diff --git a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp index 04f6d750..8640ceb8 100644 --- a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp +++ b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp @@ -2,8 +2,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - // this is remixed from usermod_v2_SensorsToMqtt.h (sensors_to_mqtt usermod) // and usermod_multi_relay.h (multi_relay usermod) diff --git a/usermods/Temperature/Temperature.cpp b/usermods/Temperature/Temperature.cpp index a17bd2d9..8c925eb1 100644 --- a/usermods/Temperature/Temperature.cpp +++ b/usermods/Temperature/Temperature.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include "OneWire.h" diff --git a/usermods/TetrisAI_v2/TetrisAI_v2.cpp b/usermods/TetrisAI_v2/TetrisAI_v2.cpp index 78cdfd22..b51250b2 100644 --- a/usermods/TetrisAI_v2/TetrisAI_v2.cpp +++ b/usermods/TetrisAI_v2/TetrisAI_v2.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include "FX.h" #include "fcn_declare.h" diff --git a/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp b/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp index 759c31c7..af3220b3 100644 --- a/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp +++ b/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp @@ -13,8 +13,6 @@ * lib_deps = ${env.lib_deps} * pololu/VL53L0X @ ^1.3.0 */ -#pragma once - #include "wled.h" #include diff --git a/usermods/boblight/boblight.cpp b/usermods/boblight/boblight.cpp index 2a52fc15..5980443d 100644 --- a/usermods/boblight/boblight.cpp +++ b/usermods/boblight/boblight.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" /* diff --git a/usermods/buzzer/buzzer.cpp b/usermods/buzzer/buzzer.cpp index e421a239..e5a071e6 100644 --- a/usermods/buzzer/buzzer.cpp +++ b/usermods/buzzer/buzzer.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include "Arduino.h" diff --git a/usermods/deep_sleep/deep_sleep.cpp b/usermods/deep_sleep/deep_sleep.cpp index 741b618f..f6f3604f 100644 --- a/usermods/deep_sleep/deep_sleep.cpp +++ b/usermods/deep_sleep/deep_sleep.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include "driver/rtc_io.h" diff --git a/usermods/mpu6050_imu/mpu6050_imu.cpp b/usermods/mpu6050_imu/mpu6050_imu.cpp index 2f8166cd..529d5dde 100644 --- a/usermods/mpu6050_imu/mpu6050_imu.cpp +++ b/usermods/mpu6050_imu/mpu6050_imu.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" /* This driver reads quaternion data from the MPU6060 and adds it to the JSON diff --git a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp index 9c8dd5f0..36e2adaa 100644 --- a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp +++ b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp @@ -1,5 +1,3 @@ -#pragma once - #warning "This usermod is deprecated and no longer maintained. It will be removed in a future WLED release. Please use usermod multi_relay which has more features." #include "wled.h" diff --git a/usermods/multi_relay/multi_relay.cpp b/usermods/multi_relay/multi_relay.cpp index ea07e281..f8b1f566 100644 --- a/usermods/multi_relay/multi_relay.cpp +++ b/usermods/multi_relay/multi_relay.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #define COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) diff --git a/usermods/pixels_dice_tray/pixels_dice_tray.cpp b/usermods/pixels_dice_tray/pixels_dice_tray.cpp index 07fd3d59..73457c67 100644 --- a/usermods/pixels_dice_tray/pixels_dice_tray.cpp +++ b/usermods/pixels_dice_tray/pixels_dice_tray.cpp @@ -1,5 +1,3 @@ -#pragma once - #include // https://github.com/axlan/arduino-pixels-dice #include "wled.h" diff --git a/usermods/pov_display/pov_display.cpp b/usermods/pov_display/pov_display.cpp index c1bd143a..b2b91f7d 100644 --- a/usermods/pov_display/pov_display.cpp +++ b/usermods/pov_display/pov_display.cpp @@ -1,4 +1,3 @@ -#pragma once #include "wled.h" #include diff --git a/usermods/pwm_outputs/pwm_outputs.cpp b/usermods/pwm_outputs/pwm_outputs.cpp index 72a78475..d94f1d84 100644 --- a/usermods/pwm_outputs/pwm_outputs.cpp +++ b/usermods/pwm_outputs/pwm_outputs.cpp @@ -1,4 +1,3 @@ -#pragma once #include "wled.h" #ifndef ESP32 diff --git a/usermods/quinled-an-penta/quinled-an-penta.cpp b/usermods/quinled-an-penta/quinled-an-penta.cpp index 1fbfd807..a3b452bf 100644 --- a/usermods/quinled-an-penta/quinled-an-penta.cpp +++ b/usermods/quinled-an-penta/quinled-an-penta.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "U8g2lib.h" #include "SHT85.h" #include "Wire.h" diff --git a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp index 5b4e7315..1514e230 100644 --- a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp +++ b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "ESPRotary.h" #include #include "wled.h" diff --git a/usermods/sd_card/sd_card.cpp b/usermods/sd_card/sd_card.cpp index e33a643f..4e68b97a 100644 --- a/usermods/sd_card/sd_card.cpp +++ b/usermods/sd_card/sd_card.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" // SD connected via MMC / SPI diff --git a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp index 02f8e8d2..c203d4ee 100644 --- a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp +++ b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp @@ -2,8 +2,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" #include #include diff --git a/usermods/seven_segment_display/seven_segment_display.cpp b/usermods/seven_segment_display/seven_segment_display.cpp index d3aa5737..de5719b2 100644 --- a/usermods/seven_segment_display/seven_segment_display.cpp +++ b/usermods/seven_segment_display/seven_segment_display.cpp @@ -2,8 +2,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" class SevenSegmentDisplay : public Usermod diff --git a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp index 812065d8..418e53b2 100644 --- a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp +++ b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp @@ -2,8 +2,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" class UsermodSSDR : public Usermod { diff --git a/usermods/sht/sht.cpp b/usermods/sht/sht.cpp index 7641bbc2..b269433e 100644 --- a/usermods/sht/sht.cpp +++ b/usermods/sht/sht.cpp @@ -2,8 +2,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "SHT85.h" #define USERMOD_SHT_TYPE_SHT30 0 diff --git a/usermods/smartnest/smartnest.cpp b/usermods/smartnest/smartnest.cpp index be7710ab..2ff13b36 100644 --- a/usermods/smartnest/smartnest.cpp +++ b/usermods/smartnest/smartnest.cpp @@ -2,8 +2,6 @@ #error "This user mod requires MQTT to be enabled." #endif -#pragma once - #include "wled.h" class Smartnest : public Usermod diff --git a/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp b/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp index 076e91f7..84c11afc 100644 --- a/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp +++ b/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" //v2 usermod that allows to change brightness and color using a rotary encoder, diff --git a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp index 2dae867d..1b97ea94 100644 --- a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp +++ b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" // v2 Usermod to automatically save settings diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp index 851e378e..93c4110c 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #undef U8X8_NO_HW_I2C // borrowed from WLEDMM: we do want I2C hardware drivers - if possible #include // from https://github.com/olikraus/u8g2/ diff --git a/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp b/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp index 55132b84..71c5c45f 100644 --- a/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp +++ b/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" class klipper_percentage : public Usermod diff --git a/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp b/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp index 8212947a..c6632b53 100644 --- a/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp +++ b/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" class PingPongClockUsermod : public Usermod diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp index ac2cc3c4..9d112984 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" // diff --git a/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp b/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp index 781dd7d8..78929238 100644 --- a/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp +++ b/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" /* diff --git a/usermods/wireguard/wireguard.cpp b/usermods/wireguard/wireguard.cpp index 77cc952f..f88bfeb3 100644 --- a/usermods/wireguard/wireguard.cpp +++ b/usermods/wireguard/wireguard.cpp @@ -1,5 +1,3 @@ -#pragma once - #include #include "wled.h" diff --git a/usermods/wizlights/wizlights.cpp b/usermods/wizlights/wizlights.cpp index 67c0effd..3ac756b1 100644 --- a/usermods/wizlights/wizlights.cpp +++ b/usermods/wizlights/wizlights.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" #include diff --git a/usermods/word-clock-matrix/word-clock-matrix.cpp b/usermods/word-clock-matrix/word-clock-matrix.cpp index 6643d293..cd8f78c3 100644 --- a/usermods/word-clock-matrix/word-clock-matrix.cpp +++ b/usermods/word-clock-matrix/word-clock-matrix.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" /* From 2b07be1d09f94c8ab87d6c35aee6fa10b40dc45b Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 19 Jan 2025 22:09:44 +0000 Subject: [PATCH 39/64] usermod mpu6050: Fix incorrect int type --- usermods/mpu6050_imu/mpu6050_imu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/mpu6050_imu/mpu6050_imu.cpp b/usermods/mpu6050_imu/mpu6050_imu.cpp index 529d5dde..6df5d64e 100644 --- a/usermods/mpu6050_imu/mpu6050_imu.cpp +++ b/usermods/mpu6050_imu/mpu6050_imu.cpp @@ -103,7 +103,7 @@ class MPU6050Driver : public Usermod { VectorInt16 aaReal; // [x, y, z] gravity-free accel sensor measurements VectorInt16 aaWorld; // [x, y, z] world-frame accel sensor measurements VectorFloat gravity; // [x, y, z] gravity vector - uint32 sample_count; + uint32_t sample_count; // Usermod output um_data_t um_data; From 44a1a1ebde1d408fbd8a52c2219ecde03e1b6682 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 19 Jan 2025 22:15:58 +0000 Subject: [PATCH 40/64] usermods: Fix MQTT checks - Check after including wled.h - Use WLED_DISABLE_MQTT instead of WLED_ENABLE_MQTT --- usermods/BH1750_v2/BH1750_v2.cpp | 8 ++++---- usermods/BME280_v2/BME280_v2.cpp | 8 ++++---- usermods/DHT/DHT.cpp | 2 +- usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp | 9 +++++---- .../Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp | 8 ++++---- usermods/LD2410_v2/LD2410_v2.cpp | 10 ++++------ usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp | 8 ++++---- usermods/mqtt_switch_v2/mqtt_switch_v2.cpp | 2 +- usermods/sensors_to_mqtt/sensors_to_mqtt.cpp | 8 ++++---- .../seven_segment_display/seven_segment_display.cpp | 6 +++--- .../seven_segment_display_reloaded.cpp | 6 +++--- usermods/sht/sht.cpp | 7 ++++--- usermods/smartnest/smartnest.cpp | 6 +++--- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/usermods/BH1750_v2/BH1750_v2.cpp b/usermods/BH1750_v2/BH1750_v2.cpp index ec29f5b9..f033f39e 100644 --- a/usermods/BH1750_v2/BH1750_v2.cpp +++ b/usermods/BH1750_v2/BH1750_v2.cpp @@ -1,13 +1,13 @@ // force the compiler to show a warning to confirm that this file is included #warning **** Included USERMOD_BH1750 **** -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - #include "wled.h" #include +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + // the max frequency to check photoresistor, 10 seconds #ifndef USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL #define USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL 10000 diff --git a/usermods/BME280_v2/BME280_v2.cpp b/usermods/BME280_v2/BME280_v2.cpp index 8cc986aa..05aeca55 100644 --- a/usermods/BME280_v2/BME280_v2.cpp +++ b/usermods/BME280_v2/BME280_v2.cpp @@ -1,15 +1,15 @@ // force the compiler to show a warning to confirm that this file is included #warning **** Included USERMOD_BME280 version 2.0 **** -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - #include "wled.h" #include #include // BME280 sensor #include // BME280 extended measurements +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + class UsermodBME280 : public Usermod { private: diff --git a/usermods/DHT/DHT.cpp b/usermods/DHT/DHT.cpp index 0b481064..2ed3dd0a 100644 --- a/usermods/DHT/DHT.cpp +++ b/usermods/DHT/DHT.cpp @@ -1,5 +1,5 @@ #include "wled.h" -#ifndef WLED_ENABLE_MQTT +#ifdef WLED_DISABLE_MQTT #error "This user mod requires MQTT to be enabled." #endif diff --git a/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp b/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp index 823ad747..d51ddb57 100644 --- a/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp +++ b/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp @@ -1,11 +1,12 @@ -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - #include "wled.h" #include #include // from https://github.com/olikraus/u8g2/ #include //Dallastemperature sensor + +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + //The SCL and SDA pins are defined here. //Lolin32 boards use SCL=5 SDA=4 #define U8X8_PIN_SCL 5 diff --git a/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp b/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp index 29a4332d..ce3c659e 100644 --- a/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp +++ b/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp @@ -1,13 +1,13 @@ -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - #include "wled.h" #include #include // from https://github.com/olikraus/u8g2/ #include #include //BME280 sensor +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + void UpdateBME280Data(); #define Celsius // Show temperature measurement in Celsius otherwise is in Fahrenheit diff --git a/usermods/LD2410_v2/LD2410_v2.cpp b/usermods/LD2410_v2/LD2410_v2.cpp index 7c1c3674..095da12f 100644 --- a/usermods/LD2410_v2/LD2410_v2.cpp +++ b/usermods/LD2410_v2/LD2410_v2.cpp @@ -1,12 +1,10 @@ -#warning **** Included USERMOD_LD2410 **** - -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - #include "wled.h" #include +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + class LD2410Usermod : public Usermod { private: diff --git a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp index 8640ceb8..44218d59 100644 --- a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp +++ b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp @@ -1,7 +1,3 @@ -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - // this is remixed from usermod_v2_SensorsToMqtt.h (sensors_to_mqtt usermod) // and usermod_multi_relay.h (multi_relay usermod) @@ -9,6 +5,10 @@ #include #include // EnvironmentCalculations::HeatIndex(), ::DewPoint(), ::AbsoluteHumidity() +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + Adafruit_Si7021 si7021; class Si7021_MQTT_HA : public Usermod diff --git a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp index 36e2adaa..2d745863 100644 --- a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp +++ b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp @@ -1,7 +1,7 @@ #warning "This usermod is deprecated and no longer maintained. It will be removed in a future WLED release. Please use usermod multi_relay which has more features." #include "wled.h" -#ifndef WLED_ENABLE_MQTT +#ifdef WLED_DISABLE_MQTT #error "This user mod requires MQTT to be enabled." #endif diff --git a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp index c203d4ee..adfdffa0 100644 --- a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp +++ b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp @@ -1,7 +1,3 @@ -#ifndef WLED_ENABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - #include "wled.h" #include #include @@ -9,6 +5,10 @@ #include #include +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + Adafruit_BMP280 bmp; Adafruit_Si7021 si7021; Adafruit_CCS811 ccs811; diff --git a/usermods/seven_segment_display/seven_segment_display.cpp b/usermods/seven_segment_display/seven_segment_display.cpp index de5719b2..13a6306b 100644 --- a/usermods/seven_segment_display/seven_segment_display.cpp +++ b/usermods/seven_segment_display/seven_segment_display.cpp @@ -1,9 +1,9 @@ -#ifndef WLED_ENABLE_MQTT +#include "wled.h" + +#ifdef WLED_DISABLE_MQTT #error "This user mod requires MQTT to be enabled." #endif -#include "wled.h" - class SevenSegmentDisplay : public Usermod { diff --git a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp index 418e53b2..3e6877d5 100644 --- a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp +++ b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp @@ -1,9 +1,9 @@ -#ifndef WLED_ENABLE_MQTT +#include "wled.h" + +#ifdef WLED_DISABLE_MQTT #error "This user mod requires MQTT to be enabled." #endif -#include "wled.h" - class UsermodSSDR : public Usermod { //#define REFRESHTIME 497 diff --git a/usermods/sht/sht.cpp b/usermods/sht/sht.cpp index b269433e..6a0e1ec4 100644 --- a/usermods/sht/sht.cpp +++ b/usermods/sht/sht.cpp @@ -1,9 +1,10 @@ -#ifndef WLED_ENABLE_MQTT +#include "wled.h" +#include "SHT85.h" + +#ifdef WLED_DISABLE_MQTT #error "This user mod requires MQTT to be enabled." #endif -#include "SHT85.h" - #define USERMOD_SHT_TYPE_SHT30 0 #define USERMOD_SHT_TYPE_SHT31 1 #define USERMOD_SHT_TYPE_SHT35 2 diff --git a/usermods/smartnest/smartnest.cpp b/usermods/smartnest/smartnest.cpp index 2ff13b36..d0cb92dc 100644 --- a/usermods/smartnest/smartnest.cpp +++ b/usermods/smartnest/smartnest.cpp @@ -1,9 +1,9 @@ -#ifndef WLED_ENABLE_MQTT +#include "wled.h" + +#ifdef WLED_DISABLE_MQTT #error "This user mod requires MQTT to be enabled." #endif -#include "wled.h" - class Smartnest : public Usermod { private: From 48372bcd91ddeeb630e86a50639d3b8e1f8edc5f Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 19 Jan 2025 22:16:20 +0000 Subject: [PATCH 41/64] platformio: Fix audioreactive usermod for ESP8266 --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 5cddbbf9..e45a4243 100644 --- a/platformio.ini +++ b/platformio.ini @@ -363,7 +363,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEAS extends = env:nodemcuv2 board_build.f_cpu = 160000000L build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP8266_160\" #-DWLED_DISABLE_2D - -D USERMOD_AUDIOREACTIVE +custom_usermods = audioreactive [env:esp8266_2m] board = esp_wroom_02 @@ -385,7 +385,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEAS extends = env:esp8266_2m board_build.f_cpu = 160000000L build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP02_160\" - -D USERMOD_AUDIOREACTIVE +custom_usermods = audioreactive [env:esp01_1m_full] board = esp01_1m @@ -408,8 +408,8 @@ build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEAS extends = env:esp01_1m_full board_build.f_cpu = 160000000L build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP01_160\" -D WLED_DISABLE_OTA - -D USERMOD_AUDIOREACTIVE ; -D WLED_USE_REAL_MATH ;; may fix wrong sunset/sunrise times, at the cost of 7064 bytes FLASH and 975 bytes RAM +custom_usermods = audioreactive [env:esp32dev] board = esp32dev From 0233daeda20bf75d6d1d37bbc49d9e3fdef1aae7 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 19 Jan 2025 22:17:12 +0000 Subject: [PATCH 42/64] usermods/sensors_to_mqtt: Fix char type --- usermods/sensors_to_mqtt/sensors_to_mqtt.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp index adfdffa0..343fd08b 100644 --- a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp +++ b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp @@ -21,7 +21,7 @@ private: float SensorPressure = 0; float SensorTemperature = 0; float SensorHumidity = 0; - char *SensorIaq = "Unknown"; + const char *SensorIaq = "Unknown"; String mqttTemperatureTopic = ""; String mqttHumidityTopic = ""; String mqttPressureTopic = ""; @@ -115,7 +115,7 @@ private: /** * Credits: Bouke_Regnerus @ https://community.home-assistant.io/t/example-indoor-air-quality-text-sensor-using-ccs811-sensor/125854 */ - char *_getIaqIndex(float humidity, int tvoc, int eco2) + const char *_getIaqIndex(float humidity, int tvoc, int eco2) { int iaq_index = 0; @@ -214,6 +214,7 @@ private: { return "Excellent"; } + return "Unknown"; } public: From 30a697e708b78c325c2b508ea7192f835061d22a Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 19 Jan 2025 22:19:01 +0000 Subject: [PATCH 43/64] usermods/PWM_fan: Disable pending cross-mod check A better solution for cross-module communication is required! --- usermods/PWM_fan/{library.json => library.json.disabled} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename usermods/PWM_fan/{library.json => library.json.disabled} (100%) diff --git a/usermods/PWM_fan/library.json b/usermods/PWM_fan/library.json.disabled similarity index 100% rename from usermods/PWM_fan/library.json rename to usermods/PWM_fan/library.json.disabled From 1d558e8391bb234c8189b2c5211f9b643b70f609 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sun, 19 Jan 2025 22:25:34 +0000 Subject: [PATCH 44/64] platformio.ini: Add extra flags for usermod test Define a couple pins, leave a note where the usermod list comes from. --- platformio.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index e45a4243..9d346fa5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -630,7 +630,10 @@ board = esp32dev platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\" + -DTOUCH_CS=9 + -DMQTTSWITCHPINS=8 lib_deps = ${esp32_idf_V4.lib_deps} monitor_filters = esp32_exception_decoder board_build.flash_mode = dio -board_build.partitions = ${esp32.big_partitions} +; custom_usermods = *every folder with library.json* -- injected by pio-scripts/load_usermods.py +board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat From 0d44e7ec272b130f7e3eccf1d1f20a5405a327fe Mon Sep 17 00:00:00 2001 From: Will Miles Date: Tue, 21 Jan 2025 00:12:37 +0000 Subject: [PATCH 45/64] Usermods: Remove libArchive This is now managed centrally. --- usermods/ADS1115_v2/library.json | 1 - usermods/AHT10_v2/library.json | 1 - usermods/Analog_Clock/library.json | 3 +-- usermods/Animated_Staircase/library.json | 3 +-- usermods/BH1750_v2/library.json | 1 - usermods/BME280_v2/library.json.disabled | 1 - usermods/Battery/library.json | 3 +-- usermods/Cronixie/library.json | 3 +-- usermods/EleksTube_IPS/library.json | 1 - usermods/Internal_Temperature_v2/library.json | 3 +-- usermods/LD2410_v2/library.json | 1 - usermods/LDR_Dusk_Dawn_v2/library.json | 3 +-- usermods/MY9291/library.json.disabled | 3 +-- usermods/PIR_sensor_switch/library.json | 3 +-- usermods/PWM_fan/library.json.disabled | 3 +-- usermods/RTC/library.json.disabled | 3 +-- usermods/SN_Photoresistor/library.json | 3 +-- usermods/ST7789_display/library.json.disabled | 3 +-- usermods/Si7021_MQTT_HA/library.json | 1 - usermods/TetrisAI_v2/library.json | 3 +-- usermods/boblight/library.json | 3 +-- usermods/buzzer/library.json | 3 +-- usermods/deep_sleep/library.json | 3 +-- usermods/mqtt_switch_v2/library.json | 3 +-- usermods/multi_relay/library.json | 3 +-- usermods/pwm_outputs/library.json | 3 +-- usermods/sd_card/library.json | 3 +-- usermods/seven_segment_display/library.json | 3 +-- usermods/seven_segment_display_reloaded/library.json | 3 +-- usermods/sht/library.json.disabled | 3 +-- usermods/smartnest/library.json | 3 +-- usermods/stairway_wipe_basic/library.json | 3 +-- usermods/usermod_rotary_brightness_color/library.json | 3 +-- usermods/usermod_v2_HttpPullLightControl/library.json.disabled | 3 +-- usermods/usermod_v2_animartrix/library.json | 1 - usermods/usermod_v2_auto_save/library.json | 3 +-- .../usermod_v2_four_line_display_ALT/library.json.disabled | 3 +-- usermods/usermod_v2_klipper_percentage/library.json | 3 +-- usermods/usermod_v2_ping_pong_clock/library.json | 3 +-- usermods/usermod_v2_rotary_encoder_ui_ALT/library.json | 3 +-- usermods/usermod_v2_word_clock/library.json | 3 +-- usermods/wizlights/library.json | 3 +-- usermods/word-clock-matrix/library.json.disabled | 3 +-- 43 files changed, 35 insertions(+), 78 deletions(-) diff --git a/usermods/ADS1115_v2/library.json b/usermods/ADS1115_v2/library.json index 0ce2039f..0b93c935 100644 --- a/usermods/ADS1115_v2/library.json +++ b/usermods/ADS1115_v2/library.json @@ -1,6 +1,5 @@ { "name:": "ADS1115_v2", - "build": { "libArchive": false }, "dependencies": { "Adafruit BusIO": "https://github.com/adafruit/Adafruit_BusIO#1.13.2", "Adafruit ADS1X15": "https://github.com/adafruit/Adafruit_ADS1X15#2.4.0" diff --git a/usermods/AHT10_v2/library.json b/usermods/AHT10_v2/library.json index b4501ed7..94a206c5 100644 --- a/usermods/AHT10_v2/library.json +++ b/usermods/AHT10_v2/library.json @@ -1,6 +1,5 @@ { "name:": "AHT10_v2", - "build": { "libArchive": false }, "dependencies": { "enjoyneering/AHT10":"~1.1.0" } diff --git a/usermods/Analog_Clock/library.json b/usermods/Analog_Clock/library.json index 7a2fc50d..4936950e 100644 --- a/usermods/Analog_Clock/library.json +++ b/usermods/Analog_Clock/library.json @@ -1,4 +1,3 @@ { - "name:": "Analog_Clock", - "build": { "libArchive": false } + "name:": "Analog_Clock" } \ No newline at end of file diff --git a/usermods/Animated_Staircase/library.json b/usermods/Animated_Staircase/library.json index 73dc3f1b..626baa49 100644 --- a/usermods/Animated_Staircase/library.json +++ b/usermods/Animated_Staircase/library.json @@ -1,4 +1,3 @@ { - "name:": "Animated_Staircase", - "build": { "libArchive": false } + "name:": "Animated_Staircase" } \ No newline at end of file diff --git a/usermods/BH1750_v2/library.json b/usermods/BH1750_v2/library.json index 2ce4054f..b7f006cc 100644 --- a/usermods/BH1750_v2/library.json +++ b/usermods/BH1750_v2/library.json @@ -1,6 +1,5 @@ { "name:": "BH1750_v2", - "build": { "libArchive": false }, "dependencies": { "claws/BH1750":"^1.2.0" } diff --git a/usermods/BME280_v2/library.json.disabled b/usermods/BME280_v2/library.json.disabled index 1cb805d3..7ae71258 100644 --- a/usermods/BME280_v2/library.json.disabled +++ b/usermods/BME280_v2/library.json.disabled @@ -1,6 +1,5 @@ { "name:": "BME280_v2", - "build": { "libArchive": false }, "dependencies": { "finitespace/BME280":"~3.0.0" } diff --git a/usermods/Battery/library.json b/usermods/Battery/library.json index 85be8542..3f4774b8 100644 --- a/usermods/Battery/library.json +++ b/usermods/Battery/library.json @@ -1,4 +1,3 @@ { - "name:": "Battery", - "build": { "libArchive": false } + "name:": "Battery" } \ No newline at end of file diff --git a/usermods/Cronixie/library.json b/usermods/Cronixie/library.json index d22bfa45..d4832764 100644 --- a/usermods/Cronixie/library.json +++ b/usermods/Cronixie/library.json @@ -1,4 +1,3 @@ { - "name:": "Cronixie", - "build": { "libArchive": false } + "name:": "Cronixie" } \ No newline at end of file diff --git a/usermods/EleksTube_IPS/library.json b/usermods/EleksTube_IPS/library.json index 0fc259af..2cd1de6f 100644 --- a/usermods/EleksTube_IPS/library.json +++ b/usermods/EleksTube_IPS/library.json @@ -1,6 +1,5 @@ { "name:": "EleksTube_IPS", - "build": { "libArchive": false }, "dependencies": { "TFT_eSPI" : "2.5.33" } diff --git a/usermods/Internal_Temperature_v2/library.json b/usermods/Internal_Temperature_v2/library.json index dc0ae30a..6c165238 100644 --- a/usermods/Internal_Temperature_v2/library.json +++ b/usermods/Internal_Temperature_v2/library.json @@ -1,4 +1,3 @@ { - "name:": "Internal_Temperature_v2", - "build": { "libArchive": false } + "name:": "Internal_Temperature_v2" } \ No newline at end of file diff --git a/usermods/LD2410_v2/library.json b/usermods/LD2410_v2/library.json index 60d493ad..205bb822 100644 --- a/usermods/LD2410_v2/library.json +++ b/usermods/LD2410_v2/library.json @@ -1,6 +1,5 @@ { "name:": "LD2410_v2", - "build": { "libArchive": false }, "dependencies": { "ncmreynolds/ld2410":"^0.1.3" } diff --git a/usermods/LDR_Dusk_Dawn_v2/library.json b/usermods/LDR_Dusk_Dawn_v2/library.json index c5e98620..bb57dbd2 100644 --- a/usermods/LDR_Dusk_Dawn_v2/library.json +++ b/usermods/LDR_Dusk_Dawn_v2/library.json @@ -1,4 +1,3 @@ { - "name:": "LDR_Dusk_Dawn_v2", - "build": { "libArchive": false } + "name:": "LDR_Dusk_Dawn_v2" } \ No newline at end of file diff --git a/usermods/MY9291/library.json.disabled b/usermods/MY9291/library.json.disabled index ddf7aa09..9324e4a0 100644 --- a/usermods/MY9291/library.json.disabled +++ b/usermods/MY9291/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "MY9291", - "build": { "libArchive": false } + "name:": "MY9291" } \ No newline at end of file diff --git a/usermods/PIR_sensor_switch/library.json b/usermods/PIR_sensor_switch/library.json index 1c08ccc1..0ee7e18b 100644 --- a/usermods/PIR_sensor_switch/library.json +++ b/usermods/PIR_sensor_switch/library.json @@ -1,4 +1,3 @@ { - "name:": "PIR_sensor_switch", - "build": { "libArchive": false } + "name:": "PIR_sensor_switch" } \ No newline at end of file diff --git a/usermods/PWM_fan/library.json.disabled b/usermods/PWM_fan/library.json.disabled index 67f02620..904d7723 100644 --- a/usermods/PWM_fan/library.json.disabled +++ b/usermods/PWM_fan/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "PWM_fan", - "build": { "libArchive": false } + "name:": "PWM_fan" } \ No newline at end of file diff --git a/usermods/RTC/library.json.disabled b/usermods/RTC/library.json.disabled index 17bc0d53..e0c527d2 100644 --- a/usermods/RTC/library.json.disabled +++ b/usermods/RTC/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "RTC", - "build": { "libArchive": false } + "name:": "RTC" } \ No newline at end of file diff --git a/usermods/SN_Photoresistor/library.json b/usermods/SN_Photoresistor/library.json index 8e34ed3b..7cac93f8 100644 --- a/usermods/SN_Photoresistor/library.json +++ b/usermods/SN_Photoresistor/library.json @@ -1,4 +1,3 @@ { - "name:": "SN_Photoresistor", - "build": { "libArchive": false } + "name:": "SN_Photoresistor" } \ No newline at end of file diff --git a/usermods/ST7789_display/library.json.disabled b/usermods/ST7789_display/library.json.disabled index 725e20a6..abcd4635 100644 --- a/usermods/ST7789_display/library.json.disabled +++ b/usermods/ST7789_display/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "ST7789_display", - "build": { "libArchive": false } + "name:": "ST7789_display" } \ No newline at end of file diff --git a/usermods/Si7021_MQTT_HA/library.json b/usermods/Si7021_MQTT_HA/library.json index 8294c126..7b9ac4d7 100644 --- a/usermods/Si7021_MQTT_HA/library.json +++ b/usermods/Si7021_MQTT_HA/library.json @@ -1,6 +1,5 @@ { "name:": "Si7021_MQTT_HA", - "build": { "libArchive": false }, "dependencies": { "finitespace/BME280":"3.0.0" } diff --git a/usermods/TetrisAI_v2/library.json b/usermods/TetrisAI_v2/library.json index b3282288..7163dadb 100644 --- a/usermods/TetrisAI_v2/library.json +++ b/usermods/TetrisAI_v2/library.json @@ -1,4 +1,3 @@ { - "name:": "TetrisAI_v2", - "build": { "libArchive": false } + "name:": "TetrisAI_v2" } \ No newline at end of file diff --git a/usermods/boblight/library.json b/usermods/boblight/library.json index 34de5c8f..741d4cb1 100644 --- a/usermods/boblight/library.json +++ b/usermods/boblight/library.json @@ -1,4 +1,3 @@ { - "name:": "boblight", - "build": { "libArchive": false } + "name:": "boblight" } \ No newline at end of file diff --git a/usermods/buzzer/library.json b/usermods/buzzer/library.json index 6208090c..6bbcdcc3 100644 --- a/usermods/buzzer/library.json +++ b/usermods/buzzer/library.json @@ -1,4 +1,3 @@ { - "name:": "buzzer", - "build": { "libArchive": false } + "name:": "buzzer" } \ No newline at end of file diff --git a/usermods/deep_sleep/library.json b/usermods/deep_sleep/library.json index 3f4687ef..c8f66de1 100644 --- a/usermods/deep_sleep/library.json +++ b/usermods/deep_sleep/library.json @@ -1,4 +1,3 @@ { - "name:": "deep_sleep", - "build": { "libArchive": false } + "name:": "deep_sleep" } \ No newline at end of file diff --git a/usermods/mqtt_switch_v2/library.json b/usermods/mqtt_switch_v2/library.json index d6032257..cf9abefd 100644 --- a/usermods/mqtt_switch_v2/library.json +++ b/usermods/mqtt_switch_v2/library.json @@ -1,4 +1,3 @@ { - "name:": "mqtt_switch_v2", - "build": { "libArchive": false } + "name:": "mqtt_switch_v2" } \ No newline at end of file diff --git a/usermods/multi_relay/library.json b/usermods/multi_relay/library.json index cb9437e6..7aa76439 100644 --- a/usermods/multi_relay/library.json +++ b/usermods/multi_relay/library.json @@ -1,4 +1,3 @@ { - "name:": "multi_relay", - "build": { "libArchive": false } + "name:": "multi_relay" } \ No newline at end of file diff --git a/usermods/pwm_outputs/library.json b/usermods/pwm_outputs/library.json index bdb9937e..4bf07777 100644 --- a/usermods/pwm_outputs/library.json +++ b/usermods/pwm_outputs/library.json @@ -1,4 +1,3 @@ { - "name:": "pwm_outputs", - "build": { "libArchive": false } + "name:": "pwm_outputs" } \ No newline at end of file diff --git a/usermods/sd_card/library.json b/usermods/sd_card/library.json index 5b8faf16..1f123ead 100644 --- a/usermods/sd_card/library.json +++ b/usermods/sd_card/library.json @@ -1,4 +1,3 @@ { - "name:": "sd_card", - "build": { "libArchive": false } + "name:": "sd_card" } \ No newline at end of file diff --git a/usermods/seven_segment_display/library.json b/usermods/seven_segment_display/library.json index 6a306119..8764e92b 100644 --- a/usermods/seven_segment_display/library.json +++ b/usermods/seven_segment_display/library.json @@ -1,4 +1,3 @@ { - "name:": "seven_segment_display", - "build": { "libArchive": false } + "name:": "seven_segment_display" } \ No newline at end of file diff --git a/usermods/seven_segment_display_reloaded/library.json b/usermods/seven_segment_display_reloaded/library.json index 5fa5037f..fdce8b53 100644 --- a/usermods/seven_segment_display_reloaded/library.json +++ b/usermods/seven_segment_display_reloaded/library.json @@ -1,4 +1,3 @@ { - "name:": "seven_segment_display_reloaded", - "build": { "libArchive": false } + "name:": "seven_segment_display_reloaded" } \ No newline at end of file diff --git a/usermods/sht/library.json.disabled b/usermods/sht/library.json.disabled index 2788c34a..330093bd 100644 --- a/usermods/sht/library.json.disabled +++ b/usermods/sht/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "sht", - "build": { "libArchive": false } + "name:": "sht" } \ No newline at end of file diff --git a/usermods/smartnest/library.json b/usermods/smartnest/library.json index 7a9d95dd..e2c6ab35 100644 --- a/usermods/smartnest/library.json +++ b/usermods/smartnest/library.json @@ -1,4 +1,3 @@ { - "name:": "smartnest", - "build": { "libArchive": false } + "name:": "smartnest" } \ No newline at end of file diff --git a/usermods/stairway_wipe_basic/library.json b/usermods/stairway_wipe_basic/library.json index 801846ea..59cb5da9 100644 --- a/usermods/stairway_wipe_basic/library.json +++ b/usermods/stairway_wipe_basic/library.json @@ -1,4 +1,3 @@ { - "name:": "stairway_wipe_basic", - "build": { "libArchive": false } + "name:": "stairway_wipe_basic" } \ No newline at end of file diff --git a/usermods/usermod_rotary_brightness_color/library.json b/usermods/usermod_rotary_brightness_color/library.json index 5e669169..777ec19c 100644 --- a/usermods/usermod_rotary_brightness_color/library.json +++ b/usermods/usermod_rotary_brightness_color/library.json @@ -1,4 +1,3 @@ { - "name:": "usermod_rotary_brightness_color", - "build": { "libArchive": false } + "name:": "usermod_rotary_brightness_color" } \ No newline at end of file diff --git a/usermods/usermod_v2_HttpPullLightControl/library.json.disabled b/usermods/usermod_v2_HttpPullLightControl/library.json.disabled index 91735b8c..0f66710b 100644 --- a/usermods/usermod_v2_HttpPullLightControl/library.json.disabled +++ b/usermods/usermod_v2_HttpPullLightControl/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "usermod_v2_HttpPullLightControl", - "build": { "libArchive": false } + "name:": "usermod_v2_HttpPullLightControl" } \ No newline at end of file diff --git a/usermods/usermod_v2_animartrix/library.json b/usermods/usermod_v2_animartrix/library.json index 667572ba..4552be33 100644 --- a/usermods/usermod_v2_animartrix/library.json +++ b/usermods/usermod_v2_animartrix/library.json @@ -1,6 +1,5 @@ { "name": "animartrix", - "build": { "libArchive": false }, "dependencies": { "Animartrix": "https://github.com/netmindz/animartrix.git#b172586" } diff --git a/usermods/usermod_v2_auto_save/library.json b/usermods/usermod_v2_auto_save/library.json index 127767eb..d703487a 100644 --- a/usermods/usermod_v2_auto_save/library.json +++ b/usermods/usermod_v2_auto_save/library.json @@ -1,4 +1,3 @@ { - "name": "auto_save", - "build": { "libArchive": false } + "name": "auto_save" } \ No newline at end of file diff --git a/usermods/usermod_v2_four_line_display_ALT/library.json.disabled b/usermods/usermod_v2_four_line_display_ALT/library.json.disabled index 33c277bd..56612c96 100644 --- a/usermods/usermod_v2_four_line_display_ALT/library.json.disabled +++ b/usermods/usermod_v2_four_line_display_ALT/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "usermod_v2_four_line_display_ALT", - "build": { "libArchive": false } + "name:": "usermod_v2_four_line_display_ALT" } \ No newline at end of file diff --git a/usermods/usermod_v2_klipper_percentage/library.json b/usermods/usermod_v2_klipper_percentage/library.json index 99e0546c..b31fb1ad 100644 --- a/usermods/usermod_v2_klipper_percentage/library.json +++ b/usermods/usermod_v2_klipper_percentage/library.json @@ -1,4 +1,3 @@ { - "name:": "usermod_v2_klipper_percentage", - "build": { "libArchive": false } + "name:": "usermod_v2_klipper_percentage" } \ No newline at end of file diff --git a/usermods/usermod_v2_ping_pong_clock/library.json b/usermods/usermod_v2_ping_pong_clock/library.json index b3417b98..fe23cd91 100644 --- a/usermods/usermod_v2_ping_pong_clock/library.json +++ b/usermods/usermod_v2_ping_pong_clock/library.json @@ -1,4 +1,3 @@ { - "name:": "usermod_v2_ping_pong_clock", - "build": { "libArchive": false } + "name:": "usermod_v2_ping_pong_clock" } \ No newline at end of file diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json index 065c67d9..5f857218 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/library.json @@ -1,4 +1,3 @@ { - "name:": "usermod_v2_rotary_encoder_ui_ALT", - "build": { "libArchive": false } + "name:": "usermod_v2_rotary_encoder_ui_ALT" } \ No newline at end of file diff --git a/usermods/usermod_v2_word_clock/library.json b/usermods/usermod_v2_word_clock/library.json index 9e6a339d..83c14dc7 100644 --- a/usermods/usermod_v2_word_clock/library.json +++ b/usermods/usermod_v2_word_clock/library.json @@ -1,4 +1,3 @@ { - "name:": "usermod_v2_word_clock", - "build": { "libArchive": false } + "name:": "usermod_v2_word_clock" } \ No newline at end of file diff --git a/usermods/wizlights/library.json b/usermods/wizlights/library.json index 38ea759f..687fba0f 100644 --- a/usermods/wizlights/library.json +++ b/usermods/wizlights/library.json @@ -1,4 +1,3 @@ { - "name:": "wizlights", - "build": { "libArchive": false } + "name:": "wizlights" } \ No newline at end of file diff --git a/usermods/word-clock-matrix/library.json.disabled b/usermods/word-clock-matrix/library.json.disabled index 12a8bd7f..d971dfff 100644 --- a/usermods/word-clock-matrix/library.json.disabled +++ b/usermods/word-clock-matrix/library.json.disabled @@ -1,4 +1,3 @@ { - "name:": "word-clock-matrix", - "build": { "libArchive": false } + "name:": "word-clock-matrix" } \ No newline at end of file From 86f97614b0e15243391b148521f69581c539f551 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 01:32:34 +0000 Subject: [PATCH 46/64] platformio.ini: Fix esp32dev_V4 usermods --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 9d346fa5..1a239bf0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -426,9 +426,9 @@ board_build.partitions = ${esp32.default_partitions} board = esp32dev platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} +custom_usermods = audioreactive build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_V4\" #-D WLED_DISABLE_BROWNOUT_DET lib_deps = ${esp32_idf_V4.lib_deps} - ${esp32.AR_lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} board_build.flash_mode = dio From 5d392d89ce947ac92001a5c1ff9dc05e43495efe Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 01:33:34 +0000 Subject: [PATCH 47/64] load_usermods: Improve include path assembly Don't blast the path of any mentioned library - parse only the tree of the actual build deps. --- pio-scripts/load_usermods.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index 7aa6c4d8..743e5f4a 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -1,5 +1,6 @@ Import('env') import os.path +from collections import deque from pathlib import Path # For OS-agnostic path manipulation from platformio.package.manager.library import LibraryPackageManager @@ -59,6 +60,17 @@ if usermods: lm.install(spec) +# Utility function for assembling usermod include paths +def cached_add_includes(dep, dep_cache: set, includes: deque): + """ Add dep's include paths to includes if it's not in the cache """ + if dep not in dep_cache: + dep_cache.add(dep) + for include in dep.get_include_dirs(): + if include not in includes: + includes.appendleft(include) + for subdep in dep.depbuilders: + cached_add_includes(subdep, dep_cache, includes) + # Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies # Save the old value old_ConfigureProjectLibBuilder = env.ConfigureProjectLibBuilder @@ -78,16 +90,19 @@ def wrapped_ConfigureProjectLibBuilder(xenv): # Fix up include paths # In PlatformIO >=6.1.17, this could be done prior to ConfigureProjectLibBuilder wled_dir = xenv["PROJECT_SRC_DIR"] - lib_builders = xenv.GetLibBuilders() - um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents] - other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents] - for um in um_deps: + # Build a list of dependency include dirs + # TODO: Find out if this is the order that PlatformIO/SCons puts them in?? + processed_deps = set() + extra_include_dirs = deque() # Deque used for fast prepend + for dep in result.depbuilders: + cached_add_includes(dep, processed_deps, extra_include_dirs) + + for um in [dep for dep in result.depbuilders if usermod_dir in Path(dep.src_dir).parents]: # Add the wled folder to the include path um.env.PrependUnique(CPPPATH=wled_dir) # Add WLED's own dependencies - for dep in other_deps: - for dir in dep.get_include_dirs(): - um.env.PrependUnique(CPPPATH=dir) + for dir in extra_include_dirs: + um.env.PrependUnique(CPPPATH=dir) return result From 4bc3408410690413ba8fc846cd2331a18b8d2710 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 01:35:58 +0000 Subject: [PATCH 48/64] load_usermods: Don't cross usermod includes Only include paths for the base system deps, not those of other usermods. --- pio-scripts/load_usermods.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index 743e5f4a..d1016e5e 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -68,8 +68,10 @@ def cached_add_includes(dep, dep_cache: set, includes: deque): for include in dep.get_include_dirs(): if include not in includes: includes.appendleft(include) - for subdep in dep.depbuilders: - cached_add_includes(subdep, dep_cache, includes) + if usermod_dir not in Path(dep.src_dir).parents: + # Recurse, but only for NON-usermods + for subdep in dep.depbuilders: + cached_add_includes(subdep, dep_cache, includes) # Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies # Save the old value From 51db63dff7b9f9f36b832152bf2dbe57ad1edd5a Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 03:39:05 +0000 Subject: [PATCH 49/64] load_usermods: Also search for mod_v2 --- pio-scripts/load_usermods.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index d1016e5e..4ac57ba3 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -20,6 +20,9 @@ def find_usermod(mod: str): mp = usermod_dir / mod if mp.exists(): return mp + mp = usermod_dir / f"{mod}_v2" + if mp.exists(): + return mp mp = usermod_dir / f"usermod_v2_{mod}" if mp.exists(): return mp From 851e9ece0306305eba66e1cc81b6eb0b09efedd1 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 03:52:06 +0000 Subject: [PATCH 50/64] Remove deprecated mqtt_switch_v2 usermod ...it's been 3 years, and it's easier than cleaning up the readme. --- platformio.ini | 1 - usermods/mqtt_switch_v2/README.md | 54 ------- usermods/mqtt_switch_v2/library.json | 3 - usermods/mqtt_switch_v2/mqtt_switch_v2.cpp | 161 --------------------- 4 files changed, 219 deletions(-) delete mode 100644 usermods/mqtt_switch_v2/README.md delete mode 100644 usermods/mqtt_switch_v2/library.json delete mode 100644 usermods/mqtt_switch_v2/mqtt_switch_v2.cpp diff --git a/platformio.ini b/platformio.ini index f0248d42..e8ddd309 100644 --- a/platformio.ini +++ b/platformio.ini @@ -641,7 +641,6 @@ platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\" -DTOUCH_CS=9 - -DMQTTSWITCHPINS=8 lib_deps = ${esp32_idf_V4.lib_deps} monitor_filters = esp32_exception_decoder board_build.flash_mode = dio diff --git a/usermods/mqtt_switch_v2/README.md b/usermods/mqtt_switch_v2/README.md deleted file mode 100644 index 382f72d0..00000000 --- a/usermods/mqtt_switch_v2/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# DEPRECATION NOTICE -This usermod is deprecated and no longer maintained. It will be removed in a future WLED release. Please use usermod multi_relay which has more features. - - -# MQTT controllable switches -This usermod allows controlling switches (e.g. relays) via MQTT. - -## Usermod installation - -1. Copy the file `usermod_mqtt_switch.h` to the `wled00` directory. -2. Register the usermod by adding `#include "usermod_mqtt_switch.h"` in the top and `registerUsermod(new UsermodMqttSwitch());` in the bottom of `usermods_list.cpp`. - - -Example `usermods_list.cpp`: - -``` -#include "wled.h" -#include "usermod_mqtt_switch.h" - -void registerUsermods() -{ - UsermodManager::add(new UsermodMqttSwitch()); -} -``` - -## Define pins -Add a define for MQTTSWITCHPINS to platformio_override.ini. -The following example defines 3 switches connected to the GPIO pins 13, 5 and 2: - -``` -[env:livingroom] -board = esp12e -platform = ${common.platform_wled_default} -board_build.ldscript = ${common.ldscript_4m1m} -build_flags = ${common.build_flags_esp8266} - -D DATA_PINS=3 - -D BTNPIN=4 - -D RLYPIN=12 - -D RLYMDE=1 - -D STATUSPIN=15 - -D MQTTSWITCHPINS="13, 5, 2" -``` - -Pins can be inverted by setting `MQTTSWITCHINVERT`. For example `-D MQTTSWITCHINVERT="false, false, true"` would invert the switch on pin 2 in the previous example. - -The default state after booting before any MQTT message can be set by `MQTTSWITCHDEFAULTS`. For example `-D MQTTSWITCHDEFAULTS="ON, OFF, OFF"` would power on the switch on pin 13 and power off switches on pins 5 and 2. - -## MQTT topics -This usermod listens on `[mqttDeviceTopic]/switch/0/set` (where 0 is replaced with the index of the switch) for commands. Anything starting with `ON` turns on the switch, everything else turns it off. -Feedback about the current state is provided at `[mqttDeviceTopic]/switch/0/state`. - -### Home Assistant auto-discovery -Auto-discovery information is automatically published and you shouldn't have to do anything to register the switches in Home Assistant. - diff --git a/usermods/mqtt_switch_v2/library.json b/usermods/mqtt_switch_v2/library.json deleted file mode 100644 index cf9abefd..00000000 --- a/usermods/mqtt_switch_v2/library.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name:": "mqtt_switch_v2" -} \ No newline at end of file diff --git a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp b/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp deleted file mode 100644 index 2d745863..00000000 --- a/usermods/mqtt_switch_v2/mqtt_switch_v2.cpp +++ /dev/null @@ -1,161 +0,0 @@ -#warning "This usermod is deprecated and no longer maintained. It will be removed in a future WLED release. Please use usermod multi_relay which has more features." - -#include "wled.h" -#ifdef WLED_DISABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - -#ifndef MQTTSWITCHPINS -#error "Please define MQTTSWITCHPINS in platformio_override.ini. e.g. -D MQTTSWITCHPINS="12, 0, 2" " -// The following define helps Eclipse's C++ parser but is never used in production due to the #error statement on the line before -#define MQTTSWITCHPINS 12, 0, 2 -#endif - -// Default behavior: All outputs active high -#ifndef MQTTSWITCHINVERT -#define MQTTSWITCHINVERT -#endif - -// Default behavior: All outputs off -#ifndef MQTTSWITCHDEFAULTS -#define MQTTSWITCHDEFAULTS -#endif - -static const uint8_t switchPins[] = { MQTTSWITCHPINS }; -//This is a hack to get the number of pins defined by the user -#define NUM_SWITCH_PINS (sizeof(switchPins)) -static const bool switchInvert[NUM_SWITCH_PINS] = { MQTTSWITCHINVERT}; -//Make settings in config file more readable -#define ON 1 -#define OFF 0 -static const bool switchDefaults[NUM_SWITCH_PINS] = { MQTTSWITCHDEFAULTS}; -#undef ON -#undef OFF - -class UsermodMqttSwitch: public Usermod -{ -private: - bool mqttInitialized; - bool switchState[NUM_SWITCH_PINS]; - -public: - UsermodMqttSwitch() : - mqttInitialized(false) - { - } - - void setup() - { - for (int pinNr = 0; pinNr < NUM_SWITCH_PINS; pinNr++) { - setState(pinNr, switchDefaults[pinNr]); - pinMode(switchPins[pinNr], OUTPUT); - } - } - - void loop() - { - if (!mqttInitialized) { - mqttInit(); - return; // Try again in next loop iteration - } - } - - void mqttInit() - { - if (!mqtt) - return; - mqtt->onMessage( - std::bind(&UsermodMqttSwitch::onMqttMessage, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, - std::placeholders::_5, std::placeholders::_6)); - mqtt->onConnect(std::bind(&UsermodMqttSwitch::onMqttConnect, this, std::placeholders::_1)); - mqttInitialized = true; - } - - void onMqttConnect(bool sessionPresent); - - void onMqttMessage(char *topic, char *payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total); - void updateState(uint8_t pinNr); - - void setState(uint8_t pinNr, bool active) - { - if (pinNr > NUM_SWITCH_PINS) - return; - switchState[pinNr] = active; - digitalWrite((char) switchPins[pinNr], (char) (switchInvert[pinNr] ? !active : active)); - updateState(pinNr); - } -}; - -inline void UsermodMqttSwitch::onMqttConnect(bool sessionPresent) -{ - if (mqttDeviceTopic[0] == 0) - return; - - for (int pinNr = 0; pinNr < NUM_SWITCH_PINS; pinNr++) { - char buf[128]; - StaticJsonDocument<1024> json; - sprintf(buf, "%s Switch %d", serverDescription, pinNr + 1); - json[F("name")] = buf; - - sprintf(buf, "%s/switch/%d", mqttDeviceTopic, pinNr); - json["~"] = buf; - strcat(buf, "/set"); - mqtt->subscribe(buf, 0); - - json[F("stat_t")] = "~/state"; - json[F("cmd_t")] = "~/set"; - json[F("pl_off")] = F("OFF"); - json[F("pl_on")] = F("ON"); - - char uid[16]; - sprintf(uid, "%s_sw%d", escapedMac.c_str(), pinNr); - json[F("unique_id")] = uid; - - strcpy(buf, mqttDeviceTopic); - strcat(buf, "/status"); - json[F("avty_t")] = buf; - json[F("pl_avail")] = F("online"); - json[F("pl_not_avail")] = F("offline"); - //TODO: dev - sprintf(buf, "homeassistant/switch/%s/config", uid); - char json_str[1024]; - size_t payload_size = serializeJson(json, json_str); - mqtt->publish(buf, 0, true, json_str, payload_size); - updateState(pinNr); - } -} - -inline void UsermodMqttSwitch::onMqttMessage(char *topic, char *payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) -{ - //Note: Payload is not necessarily null terminated. Check "len" instead. - for (int pinNr = 0; pinNr < NUM_SWITCH_PINS; pinNr++) { - char buf[64]; - sprintf(buf, "%s/switch/%d/set", mqttDeviceTopic, pinNr); - if (strcmp(topic, buf) == 0) { - //Any string starting with "ON" is interpreted as ON, everything else as OFF - setState(pinNr, len >= 2 && payload[0] == 'O' && payload[1] == 'N'); - break; - } - } -} - -inline void UsermodMqttSwitch::updateState(uint8_t pinNr) -{ - if (!mqttInitialized) - return; - - if (pinNr > NUM_SWITCH_PINS) - return; - - char buf[64]; - sprintf(buf, "%s/switch/%d/state", mqttDeviceTopic, pinNr); - if (switchState[pinNr]) { - mqtt->publish(buf, 0, false, "ON"); - } else { - mqtt->publish(buf, 0, false, "OFF"); - } -} - - -static UsermodMqttSwitch mqtt_switch_v2; -REGISTER_USERMOD(mqtt_switch_v2); \ No newline at end of file From 070b08a9e6c7323c37ddcfbb224b531898b864e7 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 03:54:17 +0000 Subject: [PATCH 51/64] Rename usermod EXAMPLE_v2 to EXAMPLE It'd be better to not propagate the 'v2' suffix any further. This is the standard flavor of usermods now. --- usermods/EXAMPLE/library.json | 4 ++++ usermods/{EXAMPLE_v2 => EXAMPLE}/readme.md | 3 +-- .../usermod_v2_example.h => EXAMPLE/usermod_v2_example.cpp} | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 usermods/EXAMPLE/library.json rename usermods/{EXAMPLE_v2 => EXAMPLE}/readme.md (64%) rename usermods/{EXAMPLE_v2/usermod_v2_example.h => EXAMPLE/usermod_v2_example.cpp} (99%) diff --git a/usermods/EXAMPLE/library.json b/usermods/EXAMPLE/library.json new file mode 100644 index 00000000..276aba49 --- /dev/null +++ b/usermods/EXAMPLE/library.json @@ -0,0 +1,4 @@ +{ + "name:": "EXAMPLE", + "dependencies": {} +} diff --git a/usermods/EXAMPLE_v2/readme.md b/usermods/EXAMPLE/readme.md similarity index 64% rename from usermods/EXAMPLE_v2/readme.md rename to usermods/EXAMPLE/readme.md index 8917a1fb..ee8a2282 100644 --- a/usermods/EXAMPLE_v2/readme.md +++ b/usermods/EXAMPLE/readme.md @@ -4,7 +4,6 @@ In this usermod file you can find the documentation on how to take advantage of ## Installation -Copy `usermod_v2_example.h` to the wled00 directory. -Uncomment the corresponding lines in `usermods_list.cpp` and compile! +Add `EXAMPLE` to `custom_usermods` in your PlatformIO environment and compile! _(You shouldn't need to actually install this, it does nothing useful)_ diff --git a/usermods/EXAMPLE_v2/usermod_v2_example.h b/usermods/EXAMPLE/usermod_v2_example.cpp similarity index 99% rename from usermods/EXAMPLE_v2/usermod_v2_example.h rename to usermods/EXAMPLE/usermod_v2_example.cpp index df05f3e3..be4528de 100644 --- a/usermods/EXAMPLE_v2/usermod_v2_example.h +++ b/usermods/EXAMPLE/usermod_v2_example.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "wled.h" /* @@ -404,3 +402,6 @@ void MyExampleUsermod::publishMqtt(const char* state, bool retain) } #endif } + +static MyExampleUsermod example_usermod; +REGISTER_USERMOD(example_usermod); From b3f9983f449e3a0d2f1f96caebe9d325fe98b051 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 03:57:23 +0000 Subject: [PATCH 52/64] First half of usermod readme updates Describe the new usermod enable process, and update sample platformio_override.ini stubs. --- platformio_override.sample.ini | 6 +-- usermods/ADS1115_v2/readme.md | 4 +- usermods/AHT10_v2/README.md | 10 +---- usermods/Animated_Staircase/README.md | 7 ++-- usermods/BH1750_v2/readme.md | 2 +- usermods/Battery/readme.md | 4 +- usermods/Cronixie/readme.md | 2 +- usermods/DHT/platformio_override.ini | 11 ++---- usermods/DHT/readme.md | 1 - .../library.json | 4 ++ .../Fix_unreachable_netservices_v2/readme.md | 37 +----------------- ...> usermod_Fix_unreachable_netservices.cpp} | 15 ++++--- usermods/INA226_v2/README.md | 17 ++------ usermods/INA226_v2/library.json | 1 - usermods/INA226_v2/platformio_override.ini | 7 +--- usermods/Internal_Temperature_v2/readme.md | 3 +- usermods/LD2410_v2/readme.md | 10 +---- usermods/LDR_Dusk_Dawn_v2/README.md | 9 +++-- usermods/audioreactive/readme.md | 6 +-- usermods/boblight/readme.md | 3 +- usermods/deep_sleep/readme.md | 2 +- usermods/mpu6050_imu/readme.md | 39 ++++--------------- usermods/multi_relay/readme.md | 36 +---------------- 23 files changed, 51 insertions(+), 185 deletions(-) create mode 100644 usermods/Fix_unreachable_netservices_v2/library.json rename usermods/Fix_unreachable_netservices_v2/{usermod_Fix_unreachable_netservices.h => usermod_Fix_unreachable_netservices.cpp} (97%) diff --git a/platformio_override.sample.ini b/platformio_override.sample.ini index 19b8c273..60f9efe6 100644 --- a/platformio_override.sample.ini +++ b/platformio_override.sample.ini @@ -506,9 +506,8 @@ lib_deps = ${esp8266.lib_deps} extends = esp32 ;; use default esp32 platform board = esp32dev upload_speed = 921600 +custom_usermods = ${env:esp32dev.custom_usermods} RTC EleksTube_IPS build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOUT_DET -D WLED_DISABLE_INFRARED - -D USERMOD_RTC - -D USERMOD_ELEKSTUBE_IPS -D DATA_PINS=12 -D RLYPIN=27 -D BTNPIN=34 @@ -526,9 +525,6 @@ build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOU -D SPI_FREQUENCY=40000000 -D USER_SETUP_LOADED monitor_filters = esp32_exception_decoder -lib_deps = - ${esp32.lib_deps} - TFT_eSPI @ 2.5.33 ;; this is the last version that compiles with the WLED default framework - newer versions require platform = espressif32 @ ^6.3.2 # ------------------------------------------------------------------------------ # Usermod examples diff --git a/usermods/ADS1115_v2/readme.md b/usermods/ADS1115_v2/readme.md index 44092bc8..7397fc2e 100644 --- a/usermods/ADS1115_v2/readme.md +++ b/usermods/ADS1115_v2/readme.md @@ -6,5 +6,5 @@ Configuration is performed via the Usermod menu. There are no parameters to set ## Installation -Add the build flag `-D USERMOD_ADS1115` to your platformio environment. -Uncomment libraries with comment `#For ADS1115 sensor uncomment following` +Add 'ADS1115' to `custom_usermods` in your platformio environment. + diff --git a/usermods/AHT10_v2/README.md b/usermods/AHT10_v2/README.md index 69fab467..d84c1c6a 100644 --- a/usermods/AHT10_v2/README.md +++ b/usermods/AHT10_v2/README.md @@ -22,15 +22,9 @@ Dependencies, These must be added under `lib_deps` in your `platform.ini` (or `p # Compiling -To enable, compile with `USERMOD_AHT10` defined (e.g. in `platformio_override.ini`) +To enable, add 'AHT10' to `custom_usermods` in your platformio encrionment (e.g. in `platformio_override.ini`) ```ini [env:aht10_example] extends = env:esp32dev -build_flags = - ${common.build_flags} ${esp32.build_flags} - -D USERMOD_AHT10 - ; -D USERMOD_AHT10_DEBUG ; -- add a debug status to the info modal -lib_deps = - ${esp32.lib_deps} - enjoyneering/AHT10@~1.1.0 +custom_usermods = ${env:esp32dev.custom_usermods} AHT10 ``` diff --git a/usermods/Animated_Staircase/README.md b/usermods/Animated_Staircase/README.md index 2ad66b5a..c24a037e 100644 --- a/usermods/Animated_Staircase/README.md +++ b/usermods/Animated_Staircase/README.md @@ -15,10 +15,9 @@ To include this usermod in your WLED setup, you have to be able to [compile WLED Before compiling, you have to make the following modifications: -Edit `usermods_list.cpp`: -1. Open `wled00/usermods_list.cpp` -2. add `#include "../usermods/Animated_Staircase/Animated_Staircase.h"` to the top of the file -3. add `UsermodManager::add(new Animated_Staircase());` to the end of the `void registerUsermods()` function. +Edit your environment in `platformio_override.ini` +1. Open `platformio_override.ini` +2. add `Animated_Staircase` to the `custom_usermods` line for your environment You can configure usermod using the Usermods settings page. Please enter GPIO pins for PIR or ultrasonic sensors (trigger and echo). diff --git a/usermods/BH1750_v2/readme.md b/usermods/BH1750_v2/readme.md index c4aa8cb4..bba4eb71 100644 --- a/usermods/BH1750_v2/readme.md +++ b/usermods/BH1750_v2/readme.md @@ -10,7 +10,7 @@ The luminance is displayed in both the Info section of the web UI, as well as pu ## Compilation -To enable, compile with `USERMOD_BH1750` defined (e.g. in `platformio_override.ini`) +To enable, compile with `BH1750` in `custom_usermods` (e.g. in `platformio_override.ini`) ### Configuration Options The following settings can be set at compile-time but are configurable on the usermod menu (except First Measurement time): diff --git a/usermods/Battery/readme.md b/usermods/Battery/readme.md index c3d3d8bf..0e203f3a 100644 --- a/usermods/Battery/readme.md +++ b/usermods/Battery/readme.md @@ -23,9 +23,7 @@ Enables battery level monitoring of your project. ## 🎈 Installation -| **Option 1** | **Option 2** | -|--------------|--------------| -| In `wled00/my_config.h`
Add the line: `#define USERMOD_BATTERY`

[Example: my_config.h](assets/installation_my_config_h.png) | In `platformio_override.ini` (or `platformio.ini`)
Under: `build_flags =`, add the line: `-D USERMOD_BATTERY`

[Example: platformio_override.ini](assets/installation_platformio_override_ini.png) | +In `platformio_override.ini` (or `platformio.ini`)
Under: `custom_usermods =`, add the line: `Battery`

[Example: platformio_override.ini](assets/installation_platformio_override_ini.png) |

diff --git a/usermods/Cronixie/readme.md b/usermods/Cronixie/readme.md index 1eeac8ed..38efdbab 100644 --- a/usermods/Cronixie/readme.md +++ b/usermods/Cronixie/readme.md @@ -4,5 +4,5 @@ This usermod supports driving the Cronixie M and L clock kits by Diamex. ## Installation -Compile and upload after adding `-D USERMOD_CRONIXIE` to `build_flags` of your PlatformIO environment. +Compile and upload after adding `Cronixie` to `custom_usermods` of your PlatformIO environment. Make sure the Auto Brightness Limiter is enabled at 420mA (!) and configure 60 WS281x LEDs. \ No newline at end of file diff --git a/usermods/DHT/platformio_override.ini b/usermods/DHT/platformio_override.ini index d192f043..6ec2fb99 100644 --- a/usermods/DHT/platformio_override.ini +++ b/usermods/DHT/platformio_override.ini @@ -1,6 +1,5 @@ ; Options ; ------- -; USERMOD_DHT - define this to have this user mod included wled00\usermods_list.cpp ; USERMOD_DHT_DHTTYPE - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22 ; USERMOD_DHT_PIN - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board ; USERMOD_DHT_CELSIUS - define this to report temperatures in degrees celsious, otherwise fahrenheit will be reported @@ -11,13 +10,11 @@ [env:d1_mini_usermod_dht_C] extends = env:d1_mini -build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS -lib_deps = ${env:d1_mini.lib_deps} - https://github.com/alwynallan/DHT_nonblocking +custom_usermods = ${env:d1_mini.custom_usermods} DHT +build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT_CELSIUS [env:custom32_LEDPIN_16_usermod_dht_C] extends = env:custom32_LEDPIN_16 -build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS -lib_deps = ${env.lib_deps} - https://github.com/alwynallan/DHT_nonblocking +custom_usermods = ${env:custom32_LEDPIN_16.custom_usermods} DHT +build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS diff --git a/usermods/DHT/readme.md b/usermods/DHT/readme.md index 6089ffbf..9080b9b2 100644 --- a/usermods/DHT/readme.md +++ b/usermods/DHT/readme.md @@ -15,7 +15,6 @@ Copy the example `platformio_override.ini` to the root directory. This file sho ### Define Your Options -* `USERMOD_DHT` - define this to include this user mod wled00\usermods_list.cpp * `USERMOD_DHT_DHTTYPE` - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22 * `USERMOD_DHT_PIN` - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board * `USERMOD_DHT_CELSIUS` - define this to report temperatures in degrees Celsius, otherwise Fahrenheit will be reported diff --git a/usermods/Fix_unreachable_netservices_v2/library.json b/usermods/Fix_unreachable_netservices_v2/library.json new file mode 100644 index 00000000..68b31818 --- /dev/null +++ b/usermods/Fix_unreachable_netservices_v2/library.json @@ -0,0 +1,4 @@ +{ + "name:": "Fix_unreachable_netservices_v2", + "platforms": ["espressif8266"] +} diff --git a/usermods/Fix_unreachable_netservices_v2/readme.md b/usermods/Fix_unreachable_netservices_v2/readme.md index 07d64bc6..9f3889eb 100644 --- a/usermods/Fix_unreachable_netservices_v2/readme.md +++ b/usermods/Fix_unreachable_netservices_v2/readme.md @@ -30,41 +30,6 @@ The usermod supports the following state changes: ## Installation -1. Copy the file `usermod_Fix_unreachable_netservices.h` to the `wled00` directory. -2. Register the usermod by adding `#include "usermod_Fix_unreachable_netservices.h"` in the top and `registerUsermod(new FixUnreachableNetServices());` in the bottom of `usermods_list.cpp`. - -Example **usermods_list.cpp**: - -```cpp -#include "wled.h" -/* - * Register your v2 usermods here! - * (for v1 usermods using just usermod.cpp, you can ignore this file) - */ - -/* - * Add/uncomment your usermod filename here (and once more below) - * || || || - * \/ \/ \/ - */ -//#include "usermod_v2_example.h" -//#include "usermod_temperature.h" -//#include "usermod_v2_empty.h" -#include "usermod_Fix_unreachable_netservices.h" - -void registerUsermods() -{ - /* - * Add your usermod class name here - * || || || - * \/ \/ \/ - */ - //UsermodManager::add(new MyExampleUsermod()); - //UsermodManager::add(new UsermodTemperature()); - //UsermodManager::add(new UsermodRenameMe()); - UsermodManager::add(new FixUnreachableNetServices()); - -} -``` +1. Add `Fix_unreachable_netservices` to `custom_usermods` in your PlatformIO environment. Hopefully I can help someone with that - @gegu diff --git a/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.h b/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp similarity index 97% rename from usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.h rename to usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp index 3d441e59..d1a5776c 100644 --- a/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.h +++ b/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp @@ -1,12 +1,4 @@ -#pragma once - #include "wled.h" -#if defined(ESP32) -#warning "Usermod FixUnreachableNetServices works only with ESP8266 builds" -class FixUnreachableNetServices : public Usermod -{ -}; -#endif #if defined(ESP8266) #include @@ -168,4 +160,11 @@ Delay or a video demo . -## Adding Dependencies - -I2Cdev and MPU6050 must be installed. - -To install them, add electroniccats/MPU6050@1.0.1 to lib_deps in the platformio.ini file. - -For example: - -``` -lib_deps = - FastLED@3.3.2 - NeoPixelBus@2.5.7 - ESPAsyncTCP@1.2.0 - ESPAsyncUDP@697c75a025 - AsyncTCP@1.0.3 - Esp Async WebServer@1.2.0 - IRremoteESP8266@2.7.3 - electroniccats/MPU6050@1.0.1 -``` - ## Wiring The connections needed to the MPU6050 are as follows: @@ -74,18 +54,13 @@ to the info object ## Usermod installation -1. Copy the file `usermod_mpu6050_imu.h` to the `wled00` directory. -2. Register the usermod by adding `#include "usermod_mpu6050_imu.h"` in the top and `registerUsermod(new MPU6050Driver());` in the bottom of `usermods_list.cpp`. +Add `mpu6050_imu` to `custom_usermods` in your platformio_override.ini. -Example **usermods_list.cpp**: +Example **platformio_override.ini**: -```cpp -#include "wled.h" - -#include "usermod_mpu6050_imu.h" - -void registerUsermods() -{ - UsermodManager::add(new MPU6050Driver()); -} +```ini +[env:usermod_mpu6050_imu_esp32dev] +extends = env:esp32dev +custom_usermods = ${env:esp32dev.custom_usermods} + mpu6050_imu ``` diff --git a/usermods/multi_relay/readme.md b/usermods/multi_relay/readme.md index eaa069ae..543809d8 100644 --- a/usermods/multi_relay/readme.md +++ b/usermods/multi_relay/readme.md @@ -41,9 +41,7 @@ When a relay is switched, a message is published: ## Usermod installation -1. Register the usermod by adding `#include "../usermods/multi_relay/usermod_multi_relay.h"` at the top and `UsermodManager::add(new MultiRelay());` at the bottom of `usermods_list.cpp`. -or -2. Use `#define USERMOD_MULTI_RELAY` in wled.h or `-D USERMOD_MULTI_RELAY` in your platformio.ini +Add `multi_relay` to the `custom_usermods` of your platformio.ini environment. You can override the default maximum number of relays (which is 4) by defining MULTI_RELAY_MAX_RELAYS. @@ -65,38 +63,6 @@ The following definitions should be a list of values (maximum number of entries ``` These can be set via your `platformio_override.ini` file or as `#define` in your `my_config.h` (remember to set `WLED_USE_MY_CONFIG` in your `platformio_override.ini`) -Example **usermods_list.cpp**: - -```cpp -#include "wled.h" -/* - * Register your v2 usermods here! - * (for v1 usermods using just usermod.cpp, you can ignore this file) - */ - -/* - * Add/uncomment your usermod filename here (and once more below) - * || || || - * \/ \/ \/ - */ -//#include "usermod_v2_example.h" -//#include "usermod_temperature.h" -#include "../usermods/usermod_multi_relay.h" - -void registerUsermods() -{ - /* - * Add your usermod class name here - * || || || - * \/ \/ \/ - */ - //UsermodManager::add(new MyExampleUsermod()); - //UsermodManager::add(new UsermodTemperature()); - UsermodManager::add(new MultiRelay()); - -} -``` - ## Configuration Usermod can be configured via the Usermods settings page. From 7a40ef74c6f721258ff200208ff0bab1724e32df Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 31 Jan 2025 23:59:37 +0000 Subject: [PATCH 53/64] Fix up PWM_fan Use a custom setup script to check for the dependencies and pass along the required compile flags to the module; also split the object definitions for the target modules from their source so as to allow #including them. --- usermods/PWM_fan/PWM_fan.cpp | 10 +- usermods/PWM_fan/library.json | 6 ++ usermods/PWM_fan/library.json.disabled | 3 - usermods/PWM_fan/readme.md | 4 +- usermods/PWM_fan/setup_deps.py | 12 +++ usermods/Temperature/Temperature.cpp | 107 +----------------- usermods/Temperature/UsermodTemperature.h | 108 +++++++++++++++++++ usermods/Temperature/platformio_override.ini | 1 - usermods/sht/ShtUsermod.h | 71 ++++++++++++ usermods/sht/library.json | 6 ++ usermods/sht/library.json.disabled | 3 - usermods/sht/readme.md | 13 +-- usermods/sht/sht.cpp | 71 +----------- 13 files changed, 220 insertions(+), 195 deletions(-) create mode 100644 usermods/PWM_fan/library.json delete mode 100644 usermods/PWM_fan/library.json.disabled create mode 100644 usermods/PWM_fan/setup_deps.py create mode 100644 usermods/Temperature/UsermodTemperature.h create mode 100644 usermods/sht/ShtUsermod.h create mode 100644 usermods/sht/library.json delete mode 100644 usermods/sht/library.json.disabled diff --git a/usermods/PWM_fan/PWM_fan.cpp b/usermods/PWM_fan/PWM_fan.cpp index a89a1f32..a0939f08 100644 --- a/usermods/PWM_fan/PWM_fan.cpp +++ b/usermods/PWM_fan/PWM_fan.cpp @@ -1,8 +1,14 @@ -#if !defined(USERMOD_DALLASTEMPERATURE) && !defined(USERMOD_SHT) +#include "wled.h" + +#if defined(USERMOD_DALLASTEMPERATURE) +#include "UsermodTemperature.h" +#elif defined(USERMOD_SHT) +#include "ShtUsermod.h" +#else #error The "PWM fan" usermod requires "Dallas Temeprature" or "SHT" usermod to function properly. #endif -#include "wled.h" + // PWM & tacho code curtesy of @KlausMu // https://github.com/KlausMu/esp32-fan-controller/tree/main/src diff --git a/usermods/PWM_fan/library.json b/usermods/PWM_fan/library.json new file mode 100644 index 00000000..a0e53b21 --- /dev/null +++ b/usermods/PWM_fan/library.json @@ -0,0 +1,6 @@ +{ + "name:": "PWM_fan", + "build": { + "extraScript": "setup_deps.py" + } +} \ No newline at end of file diff --git a/usermods/PWM_fan/library.json.disabled b/usermods/PWM_fan/library.json.disabled deleted file mode 100644 index 904d7723..00000000 --- a/usermods/PWM_fan/library.json.disabled +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name:": "PWM_fan" -} \ No newline at end of file diff --git a/usermods/PWM_fan/readme.md b/usermods/PWM_fan/readme.md index 6a44acf3..9fecaabf 100644 --- a/usermods/PWM_fan/readme.md +++ b/usermods/PWM_fan/readme.md @@ -11,8 +11,8 @@ If the _tachometer_ is supported, the current speed (in RPM) will be displayed o ## Installation -Add the compile-time option `-D USERMOD_PWM_FAN` to your `platformio.ini` (or `platformio_override.ini`) or use `#define USERMOD_PWM_FAN` in `myconfig.h`. -You will also need `-D USERMOD_DALLASTEMPERATURE`. +Add the `PWM_fan` to `custom_usermods` in your `platformio.ini` (or `platformio_override.ini`) +You will also need `Temperature` or `sht`. ### Define Your Options diff --git a/usermods/PWM_fan/setup_deps.py b/usermods/PWM_fan/setup_deps.py new file mode 100644 index 00000000..dd29e464 --- /dev/null +++ b/usermods/PWM_fan/setup_deps.py @@ -0,0 +1,12 @@ +Import('env') + + +usermods = env.GetProjectOption("custom_usermods","").split(" ") +# Check for dependencies +if "Temperature" in usermods: + env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")]) +elif "sht" in usermods: + env.Append(CPPDEFINES=[("USERMOD_SHT")]) +else: + raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled") + diff --git a/usermods/Temperature/Temperature.cpp b/usermods/Temperature/Temperature.cpp index 8c925eb1..a2e0ea91 100644 --- a/usermods/Temperature/Temperature.cpp +++ b/usermods/Temperature/Temperature.cpp @@ -1,112 +1,7 @@ -#include "wled.h" -#include "OneWire.h" - -//Pin defaults for QuinLed Dig-Uno if not overriden -#ifndef TEMPERATURE_PIN - #ifdef ARDUINO_ARCH_ESP32 - #define TEMPERATURE_PIN 18 - #else //ESP8266 boards - #define TEMPERATURE_PIN 14 - #endif -#endif - -// the frequency to check temperature, 1 minute -#ifndef USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL -#define USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL 60000 -#endif +#include "UsermodTemperature.h" static uint16_t mode_temperature(); -class UsermodTemperature : public Usermod { - - private: - - bool initDone = false; - OneWire *oneWire; - // GPIO pin used for sensor (with a default compile-time fallback) - int8_t temperaturePin = TEMPERATURE_PIN; - // measurement unit (true==°C, false==°F) - bool degC = true; - // using parasite power on the sensor - bool parasite = false; - int8_t parasitePin = -1; - // how often do we read from sensor? - unsigned long readingInterval = USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL; - // set last reading as "40 sec before boot", so first reading is taken after 20 sec - unsigned long lastMeasurement = UINT32_MAX - USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL; - // last time requestTemperatures was called - // used to determine when we can read the sensors temperature - // we have to wait at least 93.75 ms after requestTemperatures() is called - unsigned long lastTemperaturesRequest; - float temperature; - // indicates requestTemperatures has been called but the sensor measurement is not complete - bool waitingForConversion = false; - // flag set at startup if DS18B20 sensor not found, avoids trying to keep getting - // temperature if flashed to a board without a sensor attached - byte sensorFound; - - bool enabled = true; - - bool HApublished = false; - int16_t idx = -1; // Domoticz virtual sensor idx - - // strings to reduce flash memory usage (used more than twice) - static const char _name[]; - static const char _enabled[]; - static const char _readInterval[]; - static const char _parasite[]; - static const char _parasitePin[]; - static const char _domoticzIDX[]; - static const char _sensor[]; - static const char _temperature[]; - static const char _Temperature[]; - static const char _data_fx[]; - - //Dallas sensor quick (& dirty) reading. Credit to - Author: Peter Scargill, August 17th, 2013 - float readDallas(); - void requestTemperatures(); - void readTemperature(); - bool findSensor(); -#ifndef WLED_DISABLE_MQTT - void publishHomeAssistantAutodiscovery(); -#endif - - static UsermodTemperature* _instance; // to overcome nonstatic getTemperatureC() method and avoid UsermodManager::lookup(USERMOD_ID_TEMPERATURE); - - public: - - UsermodTemperature() { _instance = this; } - static UsermodTemperature *getInstance() { return UsermodTemperature::_instance; } - - /* - * API calls te enable data exchange between WLED modules - */ - inline float getTemperatureC() { return temperature; } - inline float getTemperatureF() { return temperature * 1.8f + 32.0f; } - float getTemperature(); - const char *getTemperatureUnit(); - uint16_t getId() override { return USERMOD_ID_TEMPERATURE; } - - void setup() override; - void loop() override; - //void connected() override; -#ifndef WLED_DISABLE_MQTT - void onMqttConnect(bool sessionPresent) override; -#endif - //void onUpdateBegin(bool init) override; - - //bool handleButton(uint8_t b) override; - //void handleOverlayDraw() override; - - void addToJsonInfo(JsonObject& root) override; - //void addToJsonState(JsonObject &root) override; - //void readFromJsonState(JsonObject &root) override; - void addToConfig(JsonObject &root) override; - bool readFromConfig(JsonObject &root) override; - - void appendConfigData() override; -}; - //Dallas sensor quick (& dirty) reading. Credit to - Author: Peter Scargill, August 17th, 2013 float UsermodTemperature::readDallas() { byte data[9]; diff --git a/usermods/Temperature/UsermodTemperature.h b/usermods/Temperature/UsermodTemperature.h new file mode 100644 index 00000000..2517a2b8 --- /dev/null +++ b/usermods/Temperature/UsermodTemperature.h @@ -0,0 +1,108 @@ +#pragma once +#include "wled.h" +#include "OneWire.h" + +//Pin defaults for QuinLed Dig-Uno if not overriden +#ifndef TEMPERATURE_PIN + #ifdef ARDUINO_ARCH_ESP32 + #define TEMPERATURE_PIN 18 + #else //ESP8266 boards + #define TEMPERATURE_PIN 14 + #endif +#endif + +// the frequency to check temperature, 1 minute +#ifndef USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL +#define USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL 60000 +#endif + +class UsermodTemperature : public Usermod { + + private: + + bool initDone = false; + OneWire *oneWire; + // GPIO pin used for sensor (with a default compile-time fallback) + int8_t temperaturePin = TEMPERATURE_PIN; + // measurement unit (true==°C, false==°F) + bool degC = true; + // using parasite power on the sensor + bool parasite = false; + int8_t parasitePin = -1; + // how often do we read from sensor? + unsigned long readingInterval = USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL; + // set last reading as "40 sec before boot", so first reading is taken after 20 sec + unsigned long lastMeasurement = UINT32_MAX - USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL; + // last time requestTemperatures was called + // used to determine when we can read the sensors temperature + // we have to wait at least 93.75 ms after requestTemperatures() is called + unsigned long lastTemperaturesRequest; + float temperature; + // indicates requestTemperatures has been called but the sensor measurement is not complete + bool waitingForConversion = false; + // flag set at startup if DS18B20 sensor not found, avoids trying to keep getting + // temperature if flashed to a board without a sensor attached + byte sensorFound; + + bool enabled = true; + + bool HApublished = false; + int16_t idx = -1; // Domoticz virtual sensor idx + + // strings to reduce flash memory usage (used more than twice) + static const char _name[]; + static const char _enabled[]; + static const char _readInterval[]; + static const char _parasite[]; + static const char _parasitePin[]; + static const char _domoticzIDX[]; + static const char _sensor[]; + static const char _temperature[]; + static const char _Temperature[]; + static const char _data_fx[]; + + //Dallas sensor quick (& dirty) reading. Credit to - Author: Peter Scargill, August 17th, 2013 + float readDallas(); + void requestTemperatures(); + void readTemperature(); + bool findSensor(); +#ifndef WLED_DISABLE_MQTT + void publishHomeAssistantAutodiscovery(); +#endif + + static UsermodTemperature* _instance; // to overcome nonstatic getTemperatureC() method and avoid UsermodManager::lookup(USERMOD_ID_TEMPERATURE); + + public: + + UsermodTemperature() { _instance = this; } + static UsermodTemperature *getInstance() { return UsermodTemperature::_instance; } + + /* + * API calls te enable data exchange between WLED modules + */ + inline float getTemperatureC() { return temperature; } + inline float getTemperatureF() { return temperature * 1.8f + 32.0f; } + float getTemperature(); + const char *getTemperatureUnit(); + uint16_t getId() override { return USERMOD_ID_TEMPERATURE; } + + void setup() override; + void loop() override; + //void connected() override; +#ifndef WLED_DISABLE_MQTT + void onMqttConnect(bool sessionPresent) override; +#endif + //void onUpdateBegin(bool init) override; + + //bool handleButton(uint8_t b) override; + //void handleOverlayDraw() override; + + void addToJsonInfo(JsonObject& root) override; + //void addToJsonState(JsonObject &root) override; + //void readFromJsonState(JsonObject &root) override; + void addToConfig(JsonObject &root) override; + bool readFromConfig(JsonObject &root) override; + + void appendConfigData() override; +}; + diff --git a/usermods/Temperature/platformio_override.ini b/usermods/Temperature/platformio_override.ini index ed35b7d4..a53b5974 100644 --- a/usermods/Temperature/platformio_override.ini +++ b/usermods/Temperature/platformio_override.ini @@ -1,6 +1,5 @@ ; Options ; ------- -; USERMOD_DALLASTEMPERATURE - define this to have this user mod included wled00\usermods_list.cpp ; USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds ; diff --git a/usermods/sht/ShtUsermod.h b/usermods/sht/ShtUsermod.h new file mode 100644 index 00000000..5dd83f46 --- /dev/null +++ b/usermods/sht/ShtUsermod.h @@ -0,0 +1,71 @@ +#pragma once +#include "wled.h" + +#ifdef WLED_DISABLE_MQTT +#error "This user mod requires MQTT to be enabled." +#endif + +#define USERMOD_SHT_TYPE_SHT30 0 +#define USERMOD_SHT_TYPE_SHT31 1 +#define USERMOD_SHT_TYPE_SHT35 2 +#define USERMOD_SHT_TYPE_SHT85 3 + +class SHT; + +class ShtUsermod : public Usermod +{ + private: + bool enabled = false; // Is usermod enabled or not + bool firstRunDone = false; // Remembers if the first config load run had been done + bool initDone = false; // Remembers if the mod has been completely initialised + bool haMqttDiscovery = false; // Is MQTT discovery enabled or not + bool haMqttDiscoveryDone = false; // Remembers if we already published the HA discovery topics + + // SHT vars + SHT *shtTempHumidSensor = nullptr; // Instance of SHT lib + byte shtType = 0; // SHT sensor type to be used. Default: SHT30 + byte unitOfTemp = 0; // Temperature unit to be used. Default: Celsius (0 = Celsius, 1 = Fahrenheit) + bool shtInitDone = false; // Remembers if SHT sensor has been initialised + bool shtReadDataSuccess = false; // Did we have a successful data read and is a valid temperature and humidity available? + const byte shtI2cAddress = 0x44; // i2c address of the sensor. 0x44 is the default for all SHT sensors. Change this, if needed + unsigned long shtLastTimeUpdated = 0; // Remembers when we read data the last time + bool shtDataRequested = false; // Reading data is done async. This remembers if we asked the sensor to read data + float shtCurrentTempC = 0.0f; // Last read temperature in Celsius + float shtCurrentHumidity = 0.0f; // Last read humidity in RH% + + + void initShtTempHumiditySensor(); + void cleanupShtTempHumiditySensor(); + void cleanup(); + inline bool isShtReady() { return shtInitDone; } // Checks if the SHT sensor has been initialised. + + void publishTemperatureAndHumidityViaMqtt(); + void publishHomeAssistantAutodiscovery(); + void appendDeviceToMqttDiscoveryMessage(JsonDocument& root); + + public: + // Strings to reduce flash memory usage (used more than twice) + static const char _name[]; + static const char _enabled[]; + static const char _shtType[]; + static const char _unitOfTemp[]; + static const char _haMqttDiscovery[]; + + void setup(); + void loop(); + void onMqttConnect(bool sessionPresent); + void appendConfigData(); + void addToConfig(JsonObject &root); + bool readFromConfig(JsonObject &root); + void addToJsonInfo(JsonObject& root); + + bool isEnabled() { return enabled; } + + float getTemperature(); + float getTemperatureC() { return roundf(shtCurrentTempC * 10.0f) / 10.0f; } + float getTemperatureF() { return (getTemperatureC() * 1.8f) + 32.0f; } + float getHumidity() { return roundf(shtCurrentHumidity * 10.0f) / 10.0f; } + const char* getUnitString(); + + uint16_t getId() { return USERMOD_ID_SHT; } +}; diff --git a/usermods/sht/library.json b/usermods/sht/library.json new file mode 100644 index 00000000..fc62941a --- /dev/null +++ b/usermods/sht/library.json @@ -0,0 +1,6 @@ +{ + "name:": "sht", + "dependencies": { + "robtillaart/SHT85": "~0.3.3" + } +} \ No newline at end of file diff --git a/usermods/sht/library.json.disabled b/usermods/sht/library.json.disabled deleted file mode 100644 index 330093bd..00000000 --- a/usermods/sht/library.json.disabled +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name:": "sht" -} \ No newline at end of file diff --git a/usermods/sht/readme.md b/usermods/sht/readme.md index 0337805b..c2cc5a1f 100644 --- a/usermods/sht/readme.md +++ b/usermods/sht/readme.md @@ -5,26 +5,21 @@ Usermod to support various SHT i2c sensors like the SHT30, SHT31, SHT35 and SHT8 * "SHT85" by Rob Tillaart, v0.2 or higher: https://github.com/RobTillaart/SHT85 ## Usermod installation -Simply copy the below block (build task) to your `platformio_override.ini` and compile WLED using this new build task. Or use an existing one, add the buildflag `-D USERMOD_SHT` and the below library dependencies. + +Simply copy the below block (build task) to your `platformio_override.ini` and compile WLED using this new build task. Or use an existing one, add the custom_usermod `sht`. ESP32: ``` [env:custom_esp32dev_usermod_sht] extends = env:esp32dev -build_flags = ${common.build_flags_esp32} - -D USERMOD_SHT -lib_deps = ${esp32.lib_deps} - robtillaart/SHT85@~0.3.3 +custom_usermods = ${env:esp32dev.custom_usermods} sht ``` ESP8266: ``` [env:custom_d1_mini_usermod_sht] extends = env:d1_mini -build_flags = ${common.build_flags_esp8266} - -D USERMOD_SHT -lib_deps = ${esp8266.lib_deps} - robtillaart/SHT85@~0.3.3 +custom_usermods = ${env:d1_mini.custom_usermods} sht ``` ## MQTT Discovery for Home Assistant diff --git a/usermods/sht/sht.cpp b/usermods/sht/sht.cpp index 6a0e1ec4..e1eb9e88 100644 --- a/usermods/sht/sht.cpp +++ b/usermods/sht/sht.cpp @@ -1,73 +1,6 @@ -#include "wled.h" +#include "ShtUsermod.h" #include "SHT85.h" -#ifdef WLED_DISABLE_MQTT -#error "This user mod requires MQTT to be enabled." -#endif - -#define USERMOD_SHT_TYPE_SHT30 0 -#define USERMOD_SHT_TYPE_SHT31 1 -#define USERMOD_SHT_TYPE_SHT35 2 -#define USERMOD_SHT_TYPE_SHT85 3 - -class ShtUsermod : public Usermod -{ - private: - bool enabled = false; // Is usermod enabled or not - bool firstRunDone = false; // Remembers if the first config load run had been done - bool initDone = false; // Remembers if the mod has been completely initialised - bool haMqttDiscovery = false; // Is MQTT discovery enabled or not - bool haMqttDiscoveryDone = false; // Remembers if we already published the HA discovery topics - - // SHT vars - SHT *shtTempHumidSensor = nullptr; // Instance of SHT lib - byte shtType = 0; // SHT sensor type to be used. Default: SHT30 - byte unitOfTemp = 0; // Temperature unit to be used. Default: Celsius (0 = Celsius, 1 = Fahrenheit) - bool shtInitDone = false; // Remembers if SHT sensor has been initialised - bool shtReadDataSuccess = false; // Did we have a successful data read and is a valid temperature and humidity available? - const byte shtI2cAddress = 0x44; // i2c address of the sensor. 0x44 is the default for all SHT sensors. Change this, if needed - unsigned long shtLastTimeUpdated = 0; // Remembers when we read data the last time - bool shtDataRequested = false; // Reading data is done async. This remembers if we asked the sensor to read data - float shtCurrentTempC = 0.0f; // Last read temperature in Celsius - float shtCurrentHumidity = 0.0f; // Last read humidity in RH% - - - void initShtTempHumiditySensor(); - void cleanupShtTempHumiditySensor(); - void cleanup(); - inline bool isShtReady() { return shtInitDone; } // Checks if the SHT sensor has been initialised. - - void publishTemperatureAndHumidityViaMqtt(); - void publishHomeAssistantAutodiscovery(); - void appendDeviceToMqttDiscoveryMessage(JsonDocument& root); - - public: - // Strings to reduce flash memory usage (used more than twice) - static const char _name[]; - static const char _enabled[]; - static const char _shtType[]; - static const char _unitOfTemp[]; - static const char _haMqttDiscovery[]; - - void setup(); - void loop(); - void onMqttConnect(bool sessionPresent); - void appendConfigData(); - void addToConfig(JsonObject &root); - bool readFromConfig(JsonObject &root); - void addToJsonInfo(JsonObject& root); - - bool isEnabled() { return enabled; } - - float getTemperature(); - float getTemperatureC() { return roundf(shtCurrentTempC * 10.0f) / 10.0f; } - float getTemperatureF() { return (getTemperatureC() * 1.8f) + 32.0f; } - float getHumidity() { return roundf(shtCurrentHumidity * 10.0f) / 10.0f; } - const char* getUnitString(); - - uint16_t getId() { return USERMOD_ID_SHT; } -}; - // Strings to reduce flash memory usage (used more than twice) const char ShtUsermod::_name[] PROGMEM = "SHT-Sensor"; const char ShtUsermod::_enabled[] PROGMEM = "Enabled"; @@ -479,4 +412,4 @@ const char* ShtUsermod::getUnitString() { } static ShtUsermod sht; -REGISTER_USERMOD(sht); \ No newline at end of file +REGISTER_USERMOD(sht); From 2eff6b7a3a202638ac96b33121cea8b5ee3b1fd9 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Mon, 3 Feb 2025 17:57:09 +0000 Subject: [PATCH 54/64] usermod/sensors_to_mqtt: Add explicit dep This mod includes a header from the Adafruit Unified Sensor library inherited by its target sensor libraries. This isn't reliably picked up by PlatformIO's dependency finder. Add an explicit dep to ensure build stability. --- usermods/sensors_to_mqtt/library.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usermods/sensors_to_mqtt/library.json b/usermods/sensors_to_mqtt/library.json index 731f57b2..d38c794e 100644 --- a/usermods/sensors_to_mqtt/library.json +++ b/usermods/sensors_to_mqtt/library.json @@ -4,6 +4,7 @@ "dependencies": { "adafruit/Adafruit BMP280 Library":"2.6.8", "adafruit/Adafruit CCS811 Library":"1.1.3", - "adafruit/Adafruit Si7021 Library":"1.5.3" + "adafruit/Adafruit Si7021 Library":"1.5.3", + "adafruit/Adafruit Unified Sensor":"^1.1.15" } } From 1688546519a4bcc130a3d1936dfe09109e576450 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Mon, 3 Feb 2025 18:48:07 +0000 Subject: [PATCH 55/64] Fix RTC usermod --- usermods/RTC/{library.json.disabled => library.json} | 0 wled00/src/dependencies/time/DS1307RTC.h | 1 + 2 files changed, 1 insertion(+) rename usermods/RTC/{library.json.disabled => library.json} (100%) diff --git a/usermods/RTC/library.json.disabled b/usermods/RTC/library.json similarity index 100% rename from usermods/RTC/library.json.disabled rename to usermods/RTC/library.json diff --git a/wled00/src/dependencies/time/DS1307RTC.h b/wled00/src/dependencies/time/DS1307RTC.h index 551ae996..bc272701 100644 --- a/wled00/src/dependencies/time/DS1307RTC.h +++ b/wled00/src/dependencies/time/DS1307RTC.h @@ -7,6 +7,7 @@ #define DS1307RTC_h #include "TimeLib.h" +#include "Wire.h" // library interface description class DS1307RTC From f72b5d04e8318fb43505217d6ce3d168a1a540a1 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Mon, 3 Feb 2025 19:35:12 +0000 Subject: [PATCH 56/64] usermod/pixels_dice_try: Add missing dep The "arduino-pixels-dice" library needs the ESP32 BLE subsystem, but doesn't explicitly depend on it. --- usermods/pixels_dice_tray/library.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usermods/pixels_dice_tray/library.json b/usermods/pixels_dice_tray/library.json index ce08b801..e052fd60 100644 --- a/usermods/pixels_dice_tray/library.json +++ b/usermods/pixels_dice_tray/library.json @@ -2,6 +2,7 @@ "name:": "pixels_dice_tray", "build": { "libArchive": false}, "dependencies": { - "arduino-pixels-dice":"https://github.com/axlan/arduino-pixels-dice.git" + "arduino-pixels-dice":"https://github.com/axlan/arduino-pixels-dice.git", + "ESP32 BLE Arduino":"*" } } From 2431f2058b14c1cbcbb0e1212e83a485a48e571e Mon Sep 17 00:00:00 2001 From: Will Miles Date: Thu, 6 Feb 2025 22:23:12 -0500 Subject: [PATCH 57/64] load_usermods: Split on any whitespace This allows the common newline syntax in platformio --- pio-scripts/load_usermods.py | 2 +- usermods/PWM_fan/setup_deps.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pio-scripts/load_usermods.py b/pio-scripts/load_usermods.py index 4ac57ba3..ab3c6476 100644 --- a/pio-scripts/load_usermods.py +++ b/pio-scripts/load_usermods.py @@ -35,7 +35,7 @@ if usermods: deps = env.GetProjectOption('lib_deps') src_dir = proj.get("platformio", "src_dir") src_dir = src_dir.replace('\\','/') - mod_paths = {mod: find_usermod(mod) for mod in usermods.split(" ")} + mod_paths = {mod: find_usermod(mod) for mod in usermods.split()} usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()] proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods) # Force usermods to be installed in to the environment build state before the LDF runs diff --git a/usermods/PWM_fan/setup_deps.py b/usermods/PWM_fan/setup_deps.py index dd29e464..2f76ba85 100644 --- a/usermods/PWM_fan/setup_deps.py +++ b/usermods/PWM_fan/setup_deps.py @@ -1,7 +1,7 @@ Import('env') -usermods = env.GetProjectOption("custom_usermods","").split(" ") +usermods = env.GetProjectOption("custom_usermods","").split() # Check for dependencies if "Temperature" in usermods: env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")]) From d0b599781df00bc3ef2b6e24181116bb818361a9 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Thu, 6 Feb 2025 22:24:53 -0500 Subject: [PATCH 58/64] Fix up BME280_v2 usermod Minor compile correctness tweak --- usermods/BME280_v2/BME280_v2.cpp | 10 +++++----- usermods/BME280_v2/README.md | 11 ++--------- .../BME280_v2/{library.json.disabled => library.json} | 0 3 files changed, 7 insertions(+), 14 deletions(-) rename usermods/BME280_v2/{library.json.disabled => library.json} (100%) diff --git a/usermods/BME280_v2/BME280_v2.cpp b/usermods/BME280_v2/BME280_v2.cpp index 05aeca55..dd585904 100644 --- a/usermods/BME280_v2/BME280_v2.cpp +++ b/usermods/BME280_v2/BME280_v2.cpp @@ -239,7 +239,7 @@ public: // from the UI and values read from sensor, then publish to broker if (temperature != lastTemperature || PublishAlways) { - publishMqtt("temperature", String(temperature, TemperatureDecimals).c_str()); + publishMqtt("temperature", String(temperature, (unsigned) TemperatureDecimals).c_str()); } lastTemperature = temperature; // Update last sensor temperature for next loop @@ -252,17 +252,17 @@ public: if (humidity != lastHumidity || PublishAlways) { - publishMqtt("humidity", String(humidity, HumidityDecimals).c_str()); + publishMqtt("humidity", String(humidity, (unsigned) HumidityDecimals).c_str()); } if (heatIndex != lastHeatIndex || PublishAlways) { - publishMqtt("heat_index", String(heatIndex, TemperatureDecimals).c_str()); + publishMqtt("heat_index", String(heatIndex, (unsigned) TemperatureDecimals).c_str()); } if (dewPoint != lastDewPoint || PublishAlways) { - publishMqtt("dew_point", String(dewPoint, TemperatureDecimals).c_str()); + publishMqtt("dew_point", String(dewPoint, (unsigned) TemperatureDecimals).c_str()); } lastHumidity = humidity; @@ -279,7 +279,7 @@ public: if (pressure != lastPressure || PublishAlways) { - publishMqtt("pressure", String(pressure, PressureDecimals).c_str()); + publishMqtt("pressure", String(pressure, (unsigned) PressureDecimals).c_str()); } lastPressure = pressure; diff --git a/usermods/BME280_v2/README.md b/usermods/BME280_v2/README.md index a4fc229a..0daea582 100644 --- a/usermods/BME280_v2/README.md +++ b/usermods/BME280_v2/README.md @@ -22,7 +22,6 @@ Dependencies - Libraries - `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280)) - `Wire` - - These must be added under `lib_deps` in your `platform.ini` (or `platform_override.ini`). - Data is published over MQTT - make sure you've enabled the MQTT sync interface. - This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else is listening to the serial TX pin or your board will get confused by log messages! @@ -40,17 +39,11 @@ Methods also exist to read the read/calculated values from other WLED modules th # Compiling -To enable, compile with `USERMOD_BME280` defined (e.g. in `platformio_override.ini`) +To enable, add `BME280_v2` to your `custom_usermods` (e.g. in `platformio_override.ini`) ```ini [env:usermod_bme280_d1_mini] extends = env:d1_mini -build_flags = - ${common.build_flags_esp8266} - -D USERMOD_BME280 -lib_deps = - ${esp8266.lib_deps} - BME280@~3.0.0 - Wire +custom_usermods = ${env:d1_mini.custom_usermods} BME280_v2 ``` diff --git a/usermods/BME280_v2/library.json.disabled b/usermods/BME280_v2/library.json similarity index 100% rename from usermods/BME280_v2/library.json.disabled rename to usermods/BME280_v2/library.json From e6910f732f645512425ded8dfd2d757ea9082c14 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Thu, 6 Feb 2025 22:25:39 -0500 Subject: [PATCH 59/64] Disable EleksTube_IPS usermod For some reason, building it seems to consume 300kb of SRAM?? Probably there's still something wrong with the configuration. --- usermods/EleksTube_IPS/{library.json => library.json.disabled} | 1 + 1 file changed, 1 insertion(+) rename usermods/EleksTube_IPS/{library.json => library.json.disabled} (63%) diff --git a/usermods/EleksTube_IPS/library.json b/usermods/EleksTube_IPS/library.json.disabled similarity index 63% rename from usermods/EleksTube_IPS/library.json rename to usermods/EleksTube_IPS/library.json.disabled index 2cd1de6f..eddd12b8 100644 --- a/usermods/EleksTube_IPS/library.json +++ b/usermods/EleksTube_IPS/library.json.disabled @@ -4,3 +4,4 @@ "TFT_eSPI" : "2.5.33" } } +# Seems to add 300kb to the RAM requirement??? From c57be770397c3d974b54e8bb8974af361a41c403 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Thu, 6 Feb 2025 22:26:45 -0500 Subject: [PATCH 60/64] Fix sensor usermod globals These can be static locals instead; allows these usermods to build and link together. --- usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp | 2 +- usermods/Si7021_MQTT_HA/library.json | 3 ++- usermods/sensors_to_mqtt/sensors_to_mqtt.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp index 44218d59..7845658a 100644 --- a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp +++ b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp @@ -9,7 +9,7 @@ #error "This user mod requires MQTT to be enabled." #endif -Adafruit_Si7021 si7021; +static Adafruit_Si7021 si7021; class Si7021_MQTT_HA : public Usermod { diff --git a/usermods/Si7021_MQTT_HA/library.json b/usermods/Si7021_MQTT_HA/library.json index 7b9ac4d7..5d7aa300 100644 --- a/usermods/Si7021_MQTT_HA/library.json +++ b/usermods/Si7021_MQTT_HA/library.json @@ -1,6 +1,7 @@ { "name:": "Si7021_MQTT_HA", "dependencies": { - "finitespace/BME280":"3.0.0" + "finitespace/BME280":"3.0.0", + "adafruit/Adafruit Si7021 Library" : "1.5.3" } } \ No newline at end of file diff --git a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp index 343fd08b..5f7da97a 100644 --- a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp +++ b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp @@ -9,9 +9,9 @@ #error "This user mod requires MQTT to be enabled." #endif -Adafruit_BMP280 bmp; -Adafruit_Si7021 si7021; -Adafruit_CCS811 ccs811; +static Adafruit_BMP280 bmp; +static Adafruit_Si7021 si7021; +static Adafruit_CCS811 ccs811; class UserMod_SensorsToMQTT : public Usermod { From 078a054dbdb173f447e0c9eadb174b4898178b5d Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 7 Feb 2025 04:12:07 +0000 Subject: [PATCH 61/64] usermods/pixels_dice_tray: Fix BLE dependency --- usermods/pixels_dice_tray/library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/pixels_dice_tray/library.json b/usermods/pixels_dice_tray/library.json index e052fd60..5043c0cf 100644 --- a/usermods/pixels_dice_tray/library.json +++ b/usermods/pixels_dice_tray/library.json @@ -3,6 +3,6 @@ "build": { "libArchive": false}, "dependencies": { "arduino-pixels-dice":"https://github.com/axlan/arduino-pixels-dice.git", - "ESP32 BLE Arduino":"*" + "BLE":"*" } } From 580c2d821317b12d8eaca82115ef62e449f2bd0b Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 1 Mar 2025 20:29:37 +0000 Subject: [PATCH 62/64] usermods/MY9291: Enable for ESP8266 --- usermods/MY9291/library.json | 4 ++++ usermods/MY9291/library.json.disabled | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 usermods/MY9291/library.json delete mode 100644 usermods/MY9291/library.json.disabled diff --git a/usermods/MY9291/library.json b/usermods/MY9291/library.json new file mode 100644 index 00000000..96e0bbf9 --- /dev/null +++ b/usermods/MY9291/library.json @@ -0,0 +1,4 @@ +{ + "name:": "MY9291", + "platforms": ["espressif8266"] +} \ No newline at end of file diff --git a/usermods/MY9291/library.json.disabled b/usermods/MY9291/library.json.disabled deleted file mode 100644 index 9324e4a0..00000000 --- a/usermods/MY9291/library.json.disabled +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name:": "MY9291" -} \ No newline at end of file From 20563e6306649d373977bbd45939ce042fc52b4a Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 1 Mar 2025 20:29:59 +0000 Subject: [PATCH 63/64] usermod/Temperature: Update doc --- usermods/Temperature/readme.md | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/usermods/Temperature/readme.md b/usermods/Temperature/readme.md index 3d65be7e..b7697edc 100644 --- a/usermods/Temperature/readme.md +++ b/usermods/Temperature/readme.md @@ -11,11 +11,19 @@ Maintained by @blazoncek ## Installation -Copy the example `platformio_override.ini` to the root directory. This file should be placed in the same directory as `platformio.ini`. +Add `Temperature` to `custom_usermods` in your platformio_override.ini. + +Example **platformio_override.ini**: + +```ini +[env:usermod_temperature_esp32dev] +extends = env:esp32dev +custom_usermods = ${env:esp32dev.custom_usermods} + Temperature +``` ### Define Your Options -* `USERMOD_DALLASTEMPERATURE` - enables this user mod wled00/usermods_list.cpp * `USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL` - number of milliseconds between measurements, defaults to 60000 ms (60s) All parameters can be configured at runtime via the Usermods settings page, including pin, temperature in degrees Celsius or Fahrenheit and measurement interval. @@ -25,28 +33,6 @@ All parameters can be configured at runtime via the Usermods settings page, incl * [QuinLED-Dig-Uno](https://quinled.info/2018/09/15/quinled-dig-uno/) - Project link * [Srg74-WLED-Wemos-shield](https://github.com/srg74/WLED-wemos-shield) - another great DIY WLED board -### PlatformIO requirements - -If you are using `platformio_override.ini`, you should be able to refresh the task list and see your custom task, for example `env:d1_mini_usermod_dallas_temperature_C`. - -If you are not using `platformio_override.ini`, you might have to uncomment `OneWire@~2.3.5 under` `[common]` section in `platformio.ini`: - -```ini -# platformio.ini -... -[platformio] -... -; default_envs = esp07 -default_envs = d1_mini -... -[common] -... -lib_deps = - ... - #For Dallas sensor uncomment following - paulstoffregen/OneWire @ ~2.3.8 -``` - ## Change Log 2020-09-12 From 18a118bb7a928684cbd8306ab282caefb9b04993 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Sat, 1 Mar 2025 20:53:43 +0000 Subject: [PATCH 64/64] Update platformio version There is a necessary LDF fix in 6.1.17. --- requirements.in | 2 +- requirements.txt | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/requirements.in b/requirements.in index 7c715125..a74bd418 100644 --- a/requirements.in +++ b/requirements.in @@ -1 +1 @@ -platformio +platformio>=6.1.17 diff --git a/requirements.txt b/requirements.txt index ee70cd68..1737408a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,26 +2,24 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile +# pip-compile requirements.in # ajsonrpc==1.2.0 # via platformio -anyio==4.6.0 +anyio==4.8.0 # via starlette -bottle==0.13.1 +bottle==0.13.2 # via platformio -certifi==2024.8.30 +certifi==2025.1.31 # via requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via requests -click==8.1.7 +click==8.1.8 # via # platformio # uvicorn colorama==0.4.6 - # via - # click - # platformio + # via platformio h11==0.14.0 # via # uvicorn @@ -30,13 +28,13 @@ idna==3.10 # via # anyio # requests -marshmallow==3.22.0 +marshmallow==3.26.1 # via platformio -packaging==24.1 +packaging==24.2 # via marshmallow -platformio==6.1.16 +platformio==6.1.17 # via -r requirements.in -pyelftools==0.31 +pyelftools==0.32 # via platformio pyserial==3.5 # via platformio @@ -46,13 +44,15 @@ semantic-version==2.10.0 # via platformio sniffio==1.3.1 # via anyio -starlette==0.39.1 +starlette==0.45.3 # via platformio tabulate==0.9.0 # via platformio -urllib3==2.2.3 +typing-extensions==4.12.2 + # via anyio +urllib3==2.3.0 # via requests -uvicorn==0.30.6 +uvicorn==0.34.0 # via platformio wsproto==1.2.0 # via platformio