thermferm/server.c

changeset 606
798dd0c4fd00
parent 604
e2766e538d0e
child 614
389097dc665d
equal deleted inserted replaced
605:e00f8ff4de9a 606:798dd0c4fd00
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2008-2019 2 * Copyright (C) 2008-2020
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of the mbsePi-apps 6 * This file is part of the mbsePi-apps
7 * 7 *
1900 if (strcmp(val, UNITMODE[i]) == 0) { 1900 if (strcmp(val, UNITMODE[i]) == 0) {
1901 unit->mqtt_flag |= MQTT_FLAG_DATA; 1901 unit->mqtt_flag |= MQTT_FLAG_DATA;
1902 /* Initialize log if the unit is turned on */ 1902 /* Initialize log if the unit is turned on */
1903 if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF)) { 1903 if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF)) {
1904 unit->mqtt_flag |= MQTT_FLAG_BIRTH; 1904 unit->mqtt_flag |= MQTT_FLAG_BIRTH;
1905 } else if ((unit->mode != UNITMODE_OFF) && (i == UNITMODE_OFF)) {
1906 unit->mqtt_flag |= MQTT_FLAG_DEATH;
1907 } 1905 }
1908 syslog(LOG_NOTICE, "Fermenter unit %s mode %s to %s", unit->uuid, UNITMODE[unit->mode], UNITMODE[i]); 1906 syslog(LOG_NOTICE, "Fermenter unit %s mode %s to %s", unit->uuid, UNITMODE[unit->mode], UNITMODE[i]);
1909 unit->mode = i; 1907 unit->mode = i;
1910 /* Allways turn everything off after a mode change */ 1908 /* Allways turn everything off after a mode change */
1911 unit->PID_cool->OutP = unit->PID_heat->OutP = 0.0; 1909 unit->PID_cool->OutP = unit->PID_heat->OutP = 0.0;

mercurial