From 23aad24027c00ddd76ab02908ea606d0ce3db4a8 Mon Sep 17 00:00:00 2001 From: lost-hope Date: Mon, 12 Feb 2024 22:41:13 +0100 Subject: [PATCH] Fixing stairway usermod and adding buildflags Fixing Stairway: missing setup function Adding builflags: USERMOD_STAIRCASE_WIPE to install the usermod --- usermods/stairway_wipe_basic/readme.md | 10 +++++++++- .../stairway_wipe_basic/stairway-wipe-usermod-v2.h | 8 +++++--- wled00/const.h | 1 + wled00/usermods_list.cpp | 7 +++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/usermods/stairway_wipe_basic/readme.md b/usermods/stairway_wipe_basic/readme.md index 35bc0d41..353856b3 100644 --- a/usermods/stairway_wipe_basic/readme.md +++ b/usermods/stairway_wipe_basic/readme.md @@ -1,5 +1,13 @@ -### Stairway lighting +# Stairway lighting +## Install +Add the buildflag `-D USERMOD_STAIRCASE_WIPE` to your enviroment to activate it. + +### Configuration +`-D STAIRCASE_WIPE_OFF` +
Have the LEDs wipe off instead of fading out + +## Description Quick usermod to accomplish something similar to [this video](https://www.youtube.com/watch?v=NHkju5ncC4A). This usermod enables you to add a lightstrip alongside or on the steps of a staircase. diff --git a/usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h b/usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h index 9cc0bea4..f712316b 100644 --- a/usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h +++ b/usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h @@ -19,10 +19,12 @@ class StairwayWipeUsermod : public Usermod { unsigned long timeStaticStart = 0; uint16_t previousUserVar0 = 0; +//moved to buildflag //comment this out if you want the turn off effect to be just fading out instead of reverse wipe -#define STAIRCASE_WIPE_OFF +//#define STAIRCASE_WIPE_OFF public: - +void setup() { + } void loop() { //userVar0 (U0 in HTTP API): //has to be set to 1 if movement is detected on the PIR that is the same side of the staircase as the ESP8266 @@ -84,7 +86,7 @@ class StairwayWipeUsermod : public Usermod { uint16_t getId() { - return USERMOD_ID_EXAMPLE; + return USERMOD_ID_STAIRWAY_WIPE; } diff --git a/wled00/const.h b/wled00/const.h index 3f4ef5cf..388b64c8 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -151,6 +151,7 @@ #define USERMOD_ID_WIREGUARD 41 //Usermod "wireguard.h" #define USERMOD_ID_INTERNAL_TEMPERATURE 42 //Usermod "usermod_internal_temperature.h" #define USERMOD_ID_LDR_DUSK_DAWN 43 //Usermod "usermod_LDR_Dusk_Dawn_v2.h" +#define USERMOD_ID_STAIRWAY_WIPE 44 //Usermod "stairway-wipe-usermod-v2.h" //Access point behavior #define AP_BEHAVIOR_BOOT_NO_CONN 0 //Open AP when no connection after boot diff --git a/wled00/usermods_list.cpp b/wled00/usermods_list.cpp index e5f9c284..db016f55 100644 --- a/wled00/usermods_list.cpp +++ b/wled00/usermods_list.cpp @@ -201,6 +201,9 @@ #include "../usermods/LDR_Dusk_Dawn_v2/usermod_LDR_Dusk_Dawn_v2.h" #endif +#ifdef USERMOD_STAIRCASE_WIPE +#include "../usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h" +#endif void registerUsermods() { /* @@ -380,4 +383,8 @@ void registerUsermods() #ifdef USERMOD_LDR_DUSK_DAWN usermods.add(new LDR_Dusk_Dawn_v2()); #endif + + #ifdef USERMOD_STAIRCASE_WIPE + usermods.add(new StairwayWipeUsermod()); + #endif }