From dc118a51e7a9f2d267159b323a0f102c0f6aa7fa Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Sat, 6 Jan 2024 19:19:56 +0100 Subject: [PATCH] Fix for backlight control by sunshine --- lib/obp60task/obp60task.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index e4be59d..e1299b8 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -463,8 +463,14 @@ void OBP60Task(GwApi *api){ // Provide sundata to all pages commonData.sundata = calcSunsetSunrise(api, time->value , date->value, lat->value, lon->value, tz.toDouble()); // Backlight with sun control - if(String(backlight) == "Control by Sun"){ - setPortPin(OBP_BACKLIGHT_LED, commonData.sundata.sunDown); + if(String(backlight) == "Control by Sun"){ + if(commonData.sundata.sunDown == true){ + setBacklightLED(brightness, color); + } + else{ + setBacklightLED(brightness, CRGB::Black); + } + } } }