# HG changeset patch # User Michiel Broek # Date 1532115465 -7200 # Node ID 2924fe4911d96f7032d71c72c3c7e58db12dd936 # Parent 0e4d4b45249fb77119ef00e8d3695ebdaaefb7c7 Versie 0.8.1. Geen DDATA als fermenter uit staat. Profile JSON formaat is nu werkend. diff -r 0e4d4b45249f -r 2924fe4911d9 configure --- 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" diff -r 0e4d4b45249f -r 2924fe4911d9 configure.ac --- 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) diff -r 0e4d4b45249f -r 2924fe4911d9 thermferm/mqtt.c --- 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\":"); diff -r 0e4d4b45249f -r 2924fe4911d9 thermferm/thermferm.c --- 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) {