From 9e2630a8f3887df3d8f11ee6a27d0d34b331ef28 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 18 Nov 2025 11:21:53 +0800
Subject: [PATCH] update thingsboard defconfig file

---
 project/lightd/config.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/project/lightd/config.c b/project/lightd/config.c
index f9c646c..cb5aae8 100644
--- a/project/lightd/config.c
+++ b/project/lightd/config.c
@@ -94,7 +94,25 @@
      *|       parser hardware module configuration           |
      *+------------------------------------------------------+*/
 
-    /* parser GPIO output pins  */
+    /* DS18B20 temperature sensor status */
+    hwinfo->ds18b20=iniparser_getint(ini, "hardware:ds18b20", 0);
+    if( !hwinfo->ds18b20 )
+        log_warn("Parser DS18B20 temperature module disabled\n");
+    else
+        log_info("Parser DS18B20 temperature module enabled\n");
+
+    /* TSL2561 lux sensor status */
+    hwinfo->tsl2561=iniparser_getint(ini, "hardware:tsl2561", 0);
+    if( !hwinfo->tsl2561)
+        log_warn("Parser TSL2561 lux sensor module disabled\n");
+    else
+        log_info("Parser TSL2561 lux sensor module enabled\n");
+
+    /* TSL2561 lux sensor threshold value  */
+    hwinfo->lux_threshold = iniparser_getdouble(ini, "hardware:lux_threshold", 0.1);
+    log_info("parser LUX enable and threshold value set be [%.03f]\n", hwinfo->lux_threshold);
+
+    /* parser GPIO output pins for relay */
     if( !(str=iniparser_getstring(ini, "hardware:gpio_outpin", NULL)) )
     {
         log_warn("parser no GPIO output pins\n");
@@ -108,7 +126,7 @@
     hwinfo->light_intval = iniparser_getint(ini, "hardware:light_intval", 20);
     log_info("parser relay controled light interval time [%d]\n", hwinfo->light_intval);
 
-    /* parser GPIO input pins  */
+    /* parser GPIO input pins for infrared  */
     if( !(str=iniparser_getstring(ini, "hardware:gpio_inpin", NULL)) )
     {
         log_warn("parser no GPIO input pins\n");
@@ -118,10 +136,6 @@
         parser_gpio_info(_TYPE_INPUT, &hwinfo->gpio, (char *)str);
         log_info("parser [%d] GPIO input pins\n", hwinfo->gpio.incnt);
     }
-
-    hwinfo->lux_threshold = iniparser_getdouble(ini, "hardware:lux_threshold", 0.1);
-    log_info("parser LUX enable and threshold value set be [%.03f]\n", hwinfo->lux_threshold);
-
 
     /*+------------------------------------------------------+
      *|              parser broker settings                  |
@@ -146,6 +160,7 @@
 
     str=iniparser_getstring(ini, "broker:token", NULL);
     strncpy(mqtt->token, str, sizeof(mqtt->uid) );
+    log_info("Parser broker token [%s]\n", mqtt->token);
 
     str=iniparser_getstring(ini, "broker:username", NULL);
     strncpy(mqtt->uid, str, sizeof(mqtt->uid) );
@@ -154,7 +169,7 @@
     strncpy(mqtt->pwd, str, sizeof(mqtt->pwd) );
 
     if( mqtt->uid && mqtt->pwd )
-        log_info("Parser broker author by [%s:%s]\n", mqtt->uid, mqtt->pwd);
+        log_info("Parser broker account [%s:%s]\n", mqtt->uid, mqtt->pwd);
 
     mqtt->keepalive = iniparser_getint(ini, "broker:keepalive", DEF_KEEPALIVE);
     log_info("Parser broker keepalive timeout [%d] seconds\n", mqtt->keepalive);

--
Gitblit v1.9.1