Version 0.9.9 Don't flag fermenter death if the unit is turned off. Fix a wrong log message. Send unit data even if the unit is turned off.

Mon, 18 May 2020 11:03:40 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 18 May 2020 11:03:40 +0200
changeset 606
798dd0c4fd00
parent 605
e00f8ff4de9a
child 607
021338fc4e4f

Version 0.9.9 Don't flag fermenter death if the unit is turned off. Fix a wrong log message. Send unit data even if the unit is turned off.

configure file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
thermferm/mqtt.c file | annotate | diff | comparison | revisions
thermferm/server.c file | annotate | diff | comparison | revisions
thermferm/thermferm.c file | annotate | diff | comparison | revisions
--- a/configure	Sat Apr 25 20:31:31 2020 +0200
+++ b/configure	Mon May 18 11:03:40 2020 +0200
@@ -2047,7 +2047,7 @@
 
 
 PACKAGE="mbsePi-apps"
-VERSION="0.9.8"
+VERSION="0.9.9"
 COPYRIGHT="Copyright (C) 2014-2020 Michiel Broek, All Rights Reserved"
 CYEARS="2014-2020"
 
--- a/configure.ac	Sat Apr 25 20:31:31 2020 +0200
+++ b/configure.ac	Mon May 18 11:03:40 2020 +0200
@@ -8,7 +8,7 @@
 dnl General settings
 dnl After changeing the version number, run autoconf!
 PACKAGE="mbsePi-apps"
-VERSION="0.9.8"
+VERSION="0.9.9"
 COPYRIGHT="Copyright (C) 2014-2020 Michiel Broek, All Rights Reserved"
 CYEARS="2014-2020"
 AC_SUBST(PACKAGE)
--- 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 *)"]}}");
--- a/thermferm/server.c	Sat Apr 25 20:31:31 2020 +0200
+++ b/thermferm/server.c	Mon May 18 11:03:40 2020 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2008-2019
+ * Copyright (C) 2008-2020
  *   
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -1902,8 +1902,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;
 					}
 					syslog(LOG_NOTICE, "Fermenter unit %s mode %s to %s", unit->uuid, UNITMODE[unit->mode], UNITMODE[i]);
 					unit->mode = i;
--- a/thermferm/thermferm.c	Sat Apr 25 20:31:31 2020 +0200
+++ b/thermferm/thermferm.c	Mon May 18 11:03:40 2020 +0200
@@ -405,8 +405,6 @@
     current_unit->mqtt_flag |= MQTT_FLAG_DATA;
     if ((current_unit->mode == UNITMODE_OFF) && (mode != UNITMODE_OFF)) {
 	current_unit->mqtt_flag |= MQTT_FLAG_BIRTH;
-    } else if ((current_unit->mode != UNITMODE_OFF) && (mode == UNITMODE_OFF)) {
-	current_unit->mqtt_flag |= MQTT_FLAG_DEATH;
     }
     syslog(LOG_NOTICE, "Mode from %s to %s via panel interface", UNITMODE[current_unit->mode], UNITMODE[mode]);
     current_unit->mode = mode;

mercurial