thermferm/thermferm.c

changeset 544
e2889b17f48c
parent 536
e833bbd5e733
child 545
c382a6c58c20
--- a/thermferm/thermferm.c	Tue Jul 17 19:56:58 2018 +0200
+++ b/thermferm/thermferm.c	Wed Jul 18 13:26:37 2018 +0200
@@ -975,7 +975,7 @@
 {
     char                buf[1024], *filename, target_lo[40], target_hi[40], heater[40], cooler[40], fan[40], door[40];
     char		use_heater[40], use_cooler[40], use_fan[40], room_temp[40];
-    time_t		now, last = (time_t)0;
+    time_t		now, last = (time_t)0, ndata = (time_t)0;;
     units_list		*unit;
     profiles_list	*profile;
     prof_step		*step;
@@ -1215,8 +1215,14 @@
 		}
 	    }
 	    row++;
-	    if (updateHT)
+	    /*
+	     * If TH(B) changed. or if 5 minutes without
+	     * update, send the NDATA message.
+	     */
+	    if (updateHT || (now > (ndata + 300))) {
 		publishNData(false, 0);
+		ndata = now;
+	    }
 
 	    LCDunit = 0;
 	    for (unit = Config.units; unit; unit = unit->next) {

mercurial