thermferm/mqtt.c

changeset 606
798dd0c4fd00
parent 602
ca795b871158
child 608
a69b5d92fd72
--- a/thermferm/mqtt.c	Sat Apr 25 20:31:31 2020 +0200
+++ b/thermferm/mqtt.c	Mon May 18 11:03:40 2020 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2016-2019
+ * Copyright (C) 2016-2020
  *   
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -455,8 +455,6 @@
 						/* Initialize log if the unit is turned on */
 						if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF)) {
 						    unit->mqtt_flag |= MQTT_FLAG_BIRTH;
-						} else if ((unit->mode != UNITMODE_OFF) && (i == UNITMODE_OFF)) {
-						    unit->mqtt_flag |= MQTT_FLAG_DEATH;
 						}
 						if (i == UNITMODE_PROFILE) {
 						    /* Do some checks and refuse profile mode cannot be set */
@@ -598,7 +596,7 @@
 				    if (json_object_object_get_ex(setpoint, "yeast_hi", &val)) {
 					unit->yeast_hi = json_object_get_double(val);
 					unit->mqtt_flag |= MQTT_FLAG_DATA;
-					syslog(LOG_NOTICE, "DCMD change fermenter %s: yeast_lo to `%.1f'", message_alias, unit->yeast_hi);
+					syslog(LOG_NOTICE, "DCMD change fermenter %s: yeast_hi to `%.1f'", message_alias, unit->yeast_hi);
 				    }
 				}
 
@@ -1162,7 +1160,7 @@
     payload = payload_header();
     payload = xstrcat(payload, (char *)"{\"units\":[");
     for (unit = Config.units; unit; unit = unit->next) {
-	if (unit->mode != UNITMODE_OFF) {
+//	if (unit->mode != UNITMODE_OFF) {
 	    if (comma)
 	    	payload = xstrcat(payload, (char *)",");
 	    payloadu = unit_data(unit, true);
@@ -1170,7 +1168,7 @@
 	    comma = TRUE;
 	    free(payloadu);
 	    payloadu = NULL;
-	}
+//	}
     }
     if (comma) {	// Only publish if there is at least one unit active.
     	payload = xstrcat(payload, (char *)"]}}");

mercurial