# HG changeset patch # User Michiel Broek # Date 1589792620 -7200 # Node ID 798dd0c4fd001aa8821ac9173f7cdec810366f8d # Parent e00f8ff4de9aec678d2bc9f527c937326a54ca3b 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. diff -r e00f8ff4de9a -r 798dd0c4fd00 configure --- 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" diff -r e00f8ff4de9a -r 798dd0c4fd00 configure.ac --- 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) diff -r e00f8ff4de9a -r 798dd0c4fd00 thermferm/mqtt.c --- 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 * @@ -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 *)"]}}"); diff -r e00f8ff4de9a -r 798dd0c4fd00 thermferm/server.c --- 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 * @@ -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; diff -r e00f8ff4de9a -r 798dd0c4fd00 thermferm/thermferm.c --- 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;