From cee9fee75619371dea6d26dbdaa995cb8f16f5d2 Mon Sep 17 00:00:00 2001 From: Andre Thomas Date: Mon, 18 Feb 2019 08:19:17 +0200 Subject: [PATCH 1/2] Make pwm scheme 0 sleep optional Make pwm scheme 0 sleep optional (enabled by default) --- sonoff/sonoff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index b54a32f3c..790059450 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -104,6 +104,7 @@ typedef unsigned long power_t; // Power (Relay) type #define PWM_MIN 100 // [PWM_MIN] Minimum frequency - Default: 100 // For Dimmers use double of your mains AC frequecy (100 for 50Hz and 120 for 60Hz) // For Controlling Servos use 50 and also set PWM_FREQ as 50 (DO NOT USE THESE VALUES FOR DIMMERS) +//#define PWM_LIGHTSCHEME0_IGNORE_SLEEP // Do not change sleep value for LightAnimate() scheme 0 #define DEFAULT_POWER_DELTA 80 // Power change percentage #define MAX_POWER_HOLD 10 // Time in SECONDS to allow max agreed power From 5b71095e02cedbd870a19e549b972da268b8677e Mon Sep 17 00:00:00 2001 From: Andre Thomas Date: Mon, 18 Feb 2019 08:21:57 +0200 Subject: [PATCH 2/2] Make sleep for light scheme0 optional Make sleep for light scheme0 optional with compile directive (enabled by default) --- sonoff/xdrv_04_light.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sonoff/xdrv_04_light.ino b/sonoff/xdrv_04_light.ino index 0b027335b..8a5259f64 100644 --- a/sonoff/xdrv_04_light.ino +++ b/sonoff/xdrv_04_light.ino @@ -896,7 +896,11 @@ void LightAnimate(void) } } else { +#ifdef PWM_LIGHTSCHEME0_IGNORE_SLEEP sleep = (LS_POWER == Settings.light_scheme) ? Settings.sleep : 0; // If no animation then use sleep as is +#else + sleep = 0; +#endif // PWM_LIGHTSCHEME0_IGNORE_SLEEP switch (Settings.light_scheme) { case LS_POWER: LightSetDimmer(Settings.light_dimmer);