From 05b86a71fd973c7f2dab7bc677d4cfa12ddbb61b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Tue, 11 May 2021 09:36:30 +0200 Subject: [PATCH] Sunrise/sunset debugging for PIR sensor. --- .../usermod_PIR_sensor_switch.h | 23 +++++++++++-------- wled00/wled.h | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h index 6a37f475b..cf57fff2f 100644 --- a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h +++ b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h @@ -108,16 +108,21 @@ private: uint8_t hr = hour(localTime); uint8_t mi = minute(localTime); - if (sunrise==0 || sunset==0) return false; - - if (hour(sunrise)>hr && hour(sunset)mi) { + DEBUG_PRINTF("--Time: %02d:%02d\n", (int)hr, (int)mi); + if (sunrise && sunset) { + DEBUG_PRINTLN(F("--Sunrise & sunset detected.")); + if (hour(sunrise)>hr && hour(sunset)mi) { + isDayTime = true; + DEBUG_PRINTLN(F("--It is daytime.")); + } } } return isDayTime; diff --git a/wled00/wled.h b/wled00/wled.h index 31ac3fa38..506a08c4d 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2105101 +#define VERSION 2105111 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG