Versie 0.8.1. Geen DDATA als fermenter uit staat. Profile JSON formaat is nu werkend.

Fri, 20 Jul 2018 21:37:45 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 20 Jul 2018 21:37:45 +0200
changeset 548
2924fe4911d9
parent 547
0e4d4b45249f
child 549
ee1bcad035f0

Versie 0.8.1. Geen DDATA als fermenter uit staat. Profile JSON formaat is nu werkend.

configure file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
thermferm/mqtt.c file | annotate | diff | comparison | revisions
thermferm/thermferm.c file | annotate | diff | comparison | revisions
--- a/configure	Thu Jul 19 14:08:32 2018 +0200
+++ b/configure	Fri Jul 20 21:37:45 2018 +0200
@@ -2035,7 +2035,7 @@
 
 
 PACKAGE="mbsePi-apps"
-VERSION="0.8.0"
+VERSION="0.8.1"
 COPYRIGHT="Copyright (C) 2014-2018 Michiel Broek, All Rights Reserved"
 CYEARS="2014-2018"
 
--- a/configure.ac	Thu Jul 19 14:08:32 2018 +0200
+++ b/configure.ac	Fri Jul 20 21:37:45 2018 +0200
@@ -8,7 +8,7 @@
 dnl General settings
 dnl After changeing the version number, run autoconf!
 PACKAGE="mbsePi-apps"
-VERSION="0.8.0"
+VERSION="0.8.1"
 COPYRIGHT="Copyright (C) 2014-2018 Michiel Broek, All Rights Reserved"
 CYEARS="2014-2018"
 AC_SUBST(PACKAGE)
--- a/thermferm/mqtt.c	Thu Jul 19 14:08:32 2018 +0200
+++ b/thermferm/mqtt.c	Fri Jul 20 21:37:45 2018 +0200
@@ -422,14 +422,19 @@
     /*
      * Loaded profile and state
      */
-    if (unit->mode == UNITMODE_PROFILE && unit->profile) {
+    if (unit->profile) {
 	for (profile = Config.profiles; profile; profile = profile->next) {
 	    if (strcmp(unit->profile, profile->uuid) == 0) {
 		payload = xstrcat(payload, (char *)",\"profile\":{\"uuid\":\"");
 		payload = xstrcat(payload, unit->profile);
-		payload = xstrcat(payload, (char *)",\"name\":\"");
+		payload = xstrcat(payload, (char *)"\",\"name\":\"");
 		payload = xstrcat(payload, profile->name);
-		payload = xstrcat(payload, (char *)"\",\"inittemp\":{\"low\":");
+		payload = xstrcat(payload, (char *)"\",\"state\":\"");
+		payload = xstrcat(payload, (char *)PROFSTATE[unit->prof_state]);
+		payload = xstrcat(payload, (char *)"\",\"percent\":");
+		sprintf(buf, "%d", unit->prof_percent);
+		payload = xstrcat(payload, buf);
+		payload = xstrcat(payload, (char *)",\"inittemp\":{\"low\":");
 		sprintf(buf, "%.1f", profile->inittemp_lo);
 		payload = xstrcat(payload, buf);
 		payload = xstrcat(payload, (char *)",\"high\":");
--- a/thermferm/thermferm.c	Thu Jul 19 14:08:32 2018 +0200
+++ b/thermferm/thermferm.c	Fri Jul 20 21:37:45 2018 +0200
@@ -1898,7 +1898,9 @@
 			publishDBirth(unit);
 			unit->mqtt_flag &= ~MQTT_FLAG_BIRTH;
 		    } else {
-			publishDData(unit);
+			if (unit->mode != UNITMODE_OFF) {
+			    publishDData(unit);
+			}
 			unit->mqtt_flag &= ~MQTT_FLAG_DATA;
 		    }
 		    if (unit->mqtt_flag & MQTT_FLAG_DEATH) {

mercurial