thermferm/thermferm.c

changeset 510
2da3d3340403
parent 507
80344f433a78
child 515
7ab5cf2afc0c
equal deleted inserted replaced
509:b5ae9017194f 510:2da3d3340403
393 { 393 {
394 if ((current_unit->mode == UNITMODE_OFF) && (mode != UNITMODE_OFF)) 394 if ((current_unit->mode == UNITMODE_OFF) && (mode != UNITMODE_OFF))
395 initlog(current_unit->name); 395 initlog(current_unit->name);
396 syslog(LOG_NOTICE, "Mode from %s to %s via panel interface", UNITMODE[current_unit->mode], UNITMODE[mode]); 396 syslog(LOG_NOTICE, "Mode from %s to %s via panel interface", UNITMODE[current_unit->mode], UNITMODE[mode]);
397 current_unit->mode = mode; 397 current_unit->mode = mode;
398 current_unit->mqtt_flag |= (MQTT_FLAG_SP | MQTT_FLAG_MODE); 398 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
399 /* Allways turn everything off after a mode change */ 399 /* Allways turn everything off after a mode change */
400 current_unit->PID_cool->OutP = current_unit->PID_heat->OutP = 0.0; 400 current_unit->PID_cool->OutP = current_unit->PID_heat->OutP = 0.0;
401 current_unit->PID_cool->Mode = current_unit->PID_heat->Mode = PID_MODE_NONE; 401 current_unit->PID_cool->Mode = current_unit->PID_heat->Mode = PID_MODE_NONE;
402 current_unit->heater_state = current_unit->cooler_state = current_unit->fan_state = current_unit->light_state = 0; 402 current_unit->heater_state = current_unit->cooler_state = current_unit->fan_state = current_unit->light_state = 0;
403 current_unit->heater_wait = current_unit->cooler_wait = current_unit->fan_wait = current_unit->light_wait = 0; 403 current_unit->heater_wait = current_unit->cooler_wait = current_unit->fan_wait = current_unit->light_wait = 0;
608 } 608 }
609 if (key == KEY_CONFIRM) { 609 if (key == KEY_CONFIRM) {
610 if (temp_temp != current_unit->fridge_set) { 610 if (temp_temp != current_unit->fridge_set) {
611 syslog(LOG_NOTICE, "Fridge temperature changed from %.1f to %.1f degrees from the panel", current_unit->fridge_set, temp_temp); 611 syslog(LOG_NOTICE, "Fridge temperature changed from %.1f to %.1f degrees from the panel", current_unit->fridge_set, temp_temp);
612 current_unit->fridge_set = temp_temp; 612 current_unit->fridge_set = temp_temp;
613 current_unit->mqtt_flag |= MQTT_FLAG_SP; 613 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
614 } 614 }
615 go_menu(MENU_MODE_FRIDGE); 615 go_menu(MENU_MODE_FRIDGE);
616 } 616 }
617 break; 617 break;
618 618
649 } 649 }
650 if (key == KEY_CONFIRM) { 650 if (key == KEY_CONFIRM) {
651 if (temp_temp != current_unit->beer_set) { 651 if (temp_temp != current_unit->beer_set) {
652 syslog(LOG_NOTICE, "Beer temperature changed from %.1f to %.1f degrees from the panel", current_unit->beer_set, temp_temp); 652 syslog(LOG_NOTICE, "Beer temperature changed from %.1f to %.1f degrees from the panel", current_unit->beer_set, temp_temp);
653 current_unit->beer_set = temp_temp; 653 current_unit->beer_set = temp_temp;
654 current_unit->mqtt_flag |= MQTT_FLAG_SP; 654 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
655 } 655 }
656 go_menu(MENU_MODE_BEER); 656 go_menu(MENU_MODE_BEER);
657 } 657 }
658 break; 658 break;
659 659
731 current_unit->prof_state = PROFILE_RUN; 731 current_unit->prof_state = PROFILE_RUN;
732 current_unit->prof_started = time(NULL); 732 current_unit->prof_started = time(NULL);
733 current_unit->prof_paused = current_unit->prof_primary_done = 0; 733 current_unit->prof_paused = current_unit->prof_primary_done = 0;
734 current_unit->prof_peak_abs = current_unit->prof_peak_rel = 0.0; 734 current_unit->prof_peak_abs = current_unit->prof_peak_rel = 0.0;
735 syslog(LOG_NOTICE, "Profile started from the panel"); 735 syslog(LOG_NOTICE, "Profile started from the panel");
736 current_unit->mqtt_flag |= (MQTT_FLAG_SP | MQTT_FLAG_PROFILE | MQTT_FLAG_PERCENT); 736 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
737 go_menu(MENU_MODE_PROFILE); 737 go_menu(MENU_MODE_PROFILE);
738 } 738 }
739 break; 739 break;
740 740
741 case MENU_PROFILE_PAUSE: 741 case MENU_PROFILE_PAUSE:
743 go_menu(MENU_MODE_PROFILE); 743 go_menu(MENU_MODE_PROFILE);
744 if ((key == KEY_DOWN) || (key == KEY_UP)) 744 if ((key == KEY_DOWN) || (key == KEY_UP))
745 go_menu(MENU_PROFILE_ABORT); 745 go_menu(MENU_PROFILE_ABORT);
746 if (key == KEY_ENTER) { 746 if (key == KEY_ENTER) {
747 current_unit->prof_state = PROFILE_PAUSE; 747 current_unit->prof_state = PROFILE_PAUSE;
748 current_unit->mqtt_flag |= (MQTT_FLAG_SP | MQTT_FLAG_PROFILE | MQTT_FLAG_PERCENT); 748 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
749 syslog(LOG_NOTICE, "Profile pause from the panel"); 749 syslog(LOG_NOTICE, "Profile pause from the panel");
750 go_menu(MENU_MODE_PROFILE); 750 go_menu(MENU_MODE_PROFILE);
751 } 751 }
752 break; 752 break;
753 753
762 } 762 }
763 if ((key == KEY_ENTER) && ((current_unit->prof_state == PROFILE_RUN) || (current_unit->prof_state == PROFILE_PAUSE))) { 763 if ((key == KEY_ENTER) && ((current_unit->prof_state == PROFILE_RUN) || (current_unit->prof_state == PROFILE_PAUSE))) {
764 current_unit->prof_state = PROFILE_OFF; 764 current_unit->prof_state = PROFILE_OFF;
765 current_unit->prof_started = 0; 765 current_unit->prof_started = 0;
766 syslog(LOG_NOTICE, "Profile aborted from the panel"); 766 syslog(LOG_NOTICE, "Profile aborted from the panel");
767 current_unit->mqtt_flag |= (MQTT_FLAG_SP | MQTT_FLAG_PROFILE | MQTT_FLAG_PERCENT); 767 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
768 go_menu(MENU_MODE_PROFILE); 768 go_menu(MENU_MODE_PROFILE);
769 } 769 }
770 break; 770 break;
771 771
772 case MENU_PROFILE_RESUME: 772 case MENU_PROFILE_RESUME:
775 if ((key == KEY_DOWN) || (key == KEY_UP)) 775 if ((key == KEY_DOWN) || (key == KEY_UP))
776 go_menu(MENU_PROFILE_ABORT); 776 go_menu(MENU_PROFILE_ABORT);
777 if (key == KEY_ENTER) { 777 if (key == KEY_ENTER) {
778 current_unit->prof_state = PROFILE_RUN; 778 current_unit->prof_state = PROFILE_RUN;
779 syslog(LOG_NOTICE, "Profile resume from the panel"); 779 syslog(LOG_NOTICE, "Profile resume from the panel");
780 current_unit->mqtt_flag |= (MQTT_FLAG_SP | MQTT_FLAG_PROFILE | MQTT_FLAG_PERCENT); 780 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
781 go_menu(MENU_MODE_PROFILE); 781 go_menu(MENU_MODE_PROFILE);
782 } 782 }
783 break; 783 break;
784 784
785 case MENU_PROFILE_GOOFF: 785 case MENU_PROFILE_GOOFF:
786 if (key == KEY_ESCAPE) 786 if (key == KEY_ESCAPE)
787 go_menu(MENU_MODE_PROFILE); 787 go_menu(MENU_MODE_PROFILE);
788 if (key == KEY_ENTER) { 788 if (key == KEY_ENTER) {
789 if (current_unit->prof_state == PROFILE_DONE) { 789 if (current_unit->prof_state == PROFILE_DONE) {
790 current_unit->prof_state = PROFILE_OFF; 790 current_unit->prof_state = PROFILE_OFF;
791 current_unit->mqtt_flag |= (MQTT_FLAG_SP | MQTT_FLAG_PROFILE | MQTT_FLAG_PERCENT); 791 current_unit->mqtt_flag |= MQTT_FLAG_DATA;
792 syslog(LOG_NOTICE, "Profile from done to off from the panel"); 792 syslog(LOG_NOTICE, "Profile from done to off from the panel");
793 } 793 }
794 } 794 }
795 break; 795 break;
796 796
1210 Config.hum_state = 2; 1210 Config.hum_state = 2;
1211 } 1211 }
1212 } 1212 }
1213 row++; 1213 row++;
1214 if (updateHT) 1214 if (updateHT)
1215 publishNData(false, MQTT_NODE_HT); 1215 publishNData(false, 0);
1216 1216
1217 LCDunit = 0; 1217 LCDunit = 0;
1218 for (unit = Config.units; unit; unit = unit->next) { 1218 for (unit = Config.units; unit; unit = unit->next) {
1219 LCDunit++; 1219 LCDunit++;
1220 unit->mqtt_flag = 0; 1220 unit->mqtt_flag = 0;
1232 */ 1232 */
1233 deviation = 40000; 1233 deviation = 40000;
1234 if ((unit->air_temperature == 0) || 1234 if ((unit->air_temperature == 0) ||
1235 (unit->air_temperature && (temp > (int)unit->air_temperature - deviation) && (temp < ((int)unit->air_temperature + deviation)))) { 1235 (unit->air_temperature && (temp > (int)unit->air_temperature - deviation) && (temp < ((int)unit->air_temperature + deviation)))) {
1236 if (unit->air_temperature != temp) 1236 if (unit->air_temperature != temp)
1237 unit->mqtt_flag |= MQTT_FLAG_AIR; 1237 unit->mqtt_flag |= MQTT_FLAG_DATA;
1238 unit->air_temperature = temp; 1238 unit->air_temperature = temp;
1239 unit->air_state = 0; 1239 unit->air_state = 0;
1240 } else { 1240 } else {
1241 syslog(LOG_NOTICE, "deviation error deviation=%d, old=%d new=%d", deviation, unit->air_temperature, temp); 1241 syslog(LOG_NOTICE, "deviation error deviation=%d, old=%d new=%d", deviation, unit->air_temperature, temp);
1242 } 1242 }
1252 if (rc == DEVPRESENT_YES) { 1252 if (rc == DEVPRESENT_YES) {
1253 deviation = 40000; 1253 deviation = 40000;
1254 if ((unit->beer_temperature == 0) || 1254 if ((unit->beer_temperature == 0) ||
1255 (unit->beer_temperature && (temp > (int)unit->beer_temperature - deviation) && (temp < ((int)unit->beer_temperature + deviation)))) { 1255 (unit->beer_temperature && (temp > (int)unit->beer_temperature - deviation) && (temp < ((int)unit->beer_temperature + deviation)))) {
1256 if (unit->beer_temperature != temp) 1256 if (unit->beer_temperature != temp)
1257 unit->mqtt_flag |= MQTT_FLAG_BEER; 1257 unit->mqtt_flag |= MQTT_FLAG_DATA;
1258 unit->beer_temperature = temp; 1258 unit->beer_temperature = temp;
1259 unit->beer_state = 0; 1259 unit->beer_state = 0;
1260 } else { 1260 } else {
1261 syslog(LOG_NOTICE, "deviation error deviation=%d, old=%d new=%d", deviation, unit->beer_temperature, temp); 1261 syslog(LOG_NOTICE, "deviation error deviation=%d, old=%d new=%d", deviation, unit->beer_temperature, temp);
1262 } 1262 }
1275 if (rc == DEVPRESENT_YES) { 1275 if (rc == DEVPRESENT_YES) {
1276 if (temp) { 1276 if (temp) {
1277 if (unit->door_state == 0) { 1277 if (unit->door_state == 0) {
1278 syslog(LOG_NOTICE, "Unit `%s' door closed", unit->name); 1278 syslog(LOG_NOTICE, "Unit `%s' door closed", unit->name);
1279 unit->door_state = 1; 1279 unit->door_state = 1;
1280 unit->mqtt_flag |= MQTT_FLAG_DOOR; 1280 unit->mqtt_flag |= MQTT_FLAG_DATA;
1281 } 1281 }
1282 } else { 1282 } else {
1283 if (unit->door_state) { 1283 if (unit->door_state) {
1284 syslog(LOG_NOTICE, "Unit `%s' door opened", unit->name); 1284 syslog(LOG_NOTICE, "Unit `%s' door opened", unit->name);
1285 unit->door_state = 0; 1285 unit->door_state = 0;
1286 unit->mqtt_flag |= MQTT_FLAG_DOOR; 1286 unit->mqtt_flag |= MQTT_FLAG_DATA;
1287 } 1287 }
1288 } 1288 }
1289 } else { 1289 } else {
1290 unit->door_state = 1; 1290 unit->door_state = 1;
1291 } 1291 }
1301 if (rc == DEVPRESENT_YES) { 1301 if (rc == DEVPRESENT_YES) {
1302 if (temp) { 1302 if (temp) {
1303 if (unit->psu_state == 0) { 1303 if (unit->psu_state == 0) {
1304 syslog(LOG_NOTICE, "Unit `%s' PSU (12 volt) is on", unit->name); 1304 syslog(LOG_NOTICE, "Unit `%s' PSU (12 volt) is on", unit->name);
1305 unit->psu_state = 1; 1305 unit->psu_state = 1;
1306 unit->mqtt_flag |= MQTT_FLAG_PSU; 1306 unit->mqtt_flag |= MQTT_FLAG_DATA;
1307 } 1307 }
1308 } else { 1308 } else {
1309 if (unit->psu_state) { 1309 if (unit->psu_state) {
1310 syslog(LOG_NOTICE, "Unit `%s' PSU (12 volt) is off", unit->name); 1310 syslog(LOG_NOTICE, "Unit `%s' PSU (12 volt) is off", unit->name);
1311 unit->psu_state = 0; 1311 unit->psu_state = 0;
1312 unit->mqtt_flag |= MQTT_FLAG_PSU; 1312 unit->mqtt_flag |= MQTT_FLAG_DATA;
1313 } 1313 }
1314 } 1314 }
1315 } else { 1315 } else {
1316 unit->psu_state = 1; 1316 unit->psu_state = 1;
1317 } 1317 }
1463 if (((minutes == 10) || (minutes == 40)) && (seconds == 1)) { 1463 if (((minutes == 10) || (minutes == 40)) && (seconds == 1)) {
1464 syslog(LOG_NOTICE, "Profile `%s' running %dd %02d:%02d in step %d, %d%% done, target %s %.3f..%.3f degrees", 1464 syslog(LOG_NOTICE, "Profile `%s' running %dd %02d:%02d in step %d, %d%% done, target %s %.3f..%.3f degrees",
1465 profile->name, run_hours / 24, run_hours % 24, run_minutes % 60, current_step, 1465 profile->name, run_hours / 24, run_hours % 24, run_minutes % 60, current_step,
1466 unit->prof_percent, unit->prof_fridge_mode ? (char *)"air":(char *)"beer", 1466 unit->prof_percent, unit->prof_fridge_mode ? (char *)"air":(char *)"beer",
1467 unit->prof_target_lo, unit->prof_target_hi); 1467 unit->prof_target_lo, unit->prof_target_hi);
1468 unit->mqtt_flag |= (MQTT_FLAG_PERCENT | MQTT_FLAG_PROFILE | MQTT_FLAG_SP); 1468 unit->mqtt_flag |= MQTT_FLAG_DATA;
1469 } 1469 }
1470 } else { 1470 } else {
1471 /* 1471 /*
1472 * No more steps to do 1472 * No more steps to do
1473 */ 1473 */
1474 unit->prof_state = PROFILE_DONE; 1474 unit->prof_state = PROFILE_DONE;
1475 unit->prof_percent = 100; 1475 unit->prof_percent = 100;
1476 syslog(LOG_NOTICE, "Profile `%s' is done", profile->name); 1476 syslog(LOG_NOTICE, "Profile `%s' is done", profile->name);
1477 unit->mqtt_flag |= (MQTT_FLAG_PERCENT | MQTT_FLAG_PROFILE | MQTT_FLAG_SP); 1477 unit->mqtt_flag |= MQTT_FLAG_DATA;
1478 } 1478 }
1479 break; 1479 break;
1480 1480
1481 case PROFILE_DONE: 1481 case PROFILE_DONE:
1482 /* 1482 /*
1539 if (unit->light_wait > 0) { 1539 if (unit->light_wait > 0) {
1540 unit->light_wait--; 1540 unit->light_wait--;
1541 } else { 1541 } else {
1542 unit->light_state = 0; 1542 unit->light_state = 0;
1543 syslog(LOG_NOTICE, "Unit `%s' lights On => Off", unit->name); 1543 syslog(LOG_NOTICE, "Unit `%s' lights On => Off", unit->name);
1544 unit->mqtt_flag |= MQTT_FLAG_LIGHT; 1544 unit->mqtt_flag |= MQTT_FLAG_DATA;
1545 } 1545 }
1546 } 1546 }
1547 if (!unit->door_state && !unit->light_state) { 1547 if (!unit->door_state && !unit->light_state) {
1548 unit->light_wait = unit->light_delay; /* No delay to turn lights on */ 1548 unit->light_wait = unit->light_delay; /* No delay to turn lights on */
1549 unit->light_state = 1; 1549 unit->light_state = 1;
1550 unit->mqtt_flag |= MQTT_FLAG_LIGHT; 1550 unit->mqtt_flag |= MQTT_FLAG_DATA;
1551 syslog(LOG_NOTICE, "Unit `%s' lights Off => On", unit->name); 1551 syslog(LOG_NOTICE, "Unit `%s' lights Off => On", unit->name);
1552 } 1552 }
1553 device_out(unit->light_address, unit->light_state); 1553 device_out(unit->light_address, unit->light_state);
1554 } 1554 }
1555 1555
1650 int power = round(unit->PID_heat->OutP); 1650 int power = round(unit->PID_heat->OutP);
1651 if (unit->heater_state != power) { 1651 if (unit->heater_state != power) {
1652 syslog(LOG_NOTICE, "Unit `%s' heater %d%% => %d%%", unit->name, unit->heater_state, power); 1652 syslog(LOG_NOTICE, "Unit `%s' heater %d%% => %d%%", unit->name, unit->heater_state, power);
1653 unit->heater_state = power; 1653 unit->heater_state = power;
1654 if (unit->heater_address) 1654 if (unit->heater_address)
1655 unit->mqtt_flag |= MQTT_FLAG_HEATER; 1655 unit->mqtt_flag |= MQTT_FLAG_DATA;
1656 } 1656 }
1657 } 1657 }
1658 } else { 1658 } else {
1659 if (unit->heater_wait > 0) { 1659 if (unit->heater_wait > 0) {
1660 unit->heater_wait--; 1660 unit->heater_wait--;
1661 } else { 1661 } else {
1662 if (unit->heater_state) { 1662 if (unit->heater_state) {
1663 syslog(LOG_NOTICE, "Unit `%s' heater On => Off", unit->name); 1663 syslog(LOG_NOTICE, "Unit `%s' heater On => Off", unit->name);
1664 unit->heater_state = 0; 1664 unit->heater_state = 0;
1665 if (unit->heater_address) 1665 if (unit->heater_address)
1666 unit->mqtt_flag |= MQTT_FLAG_HEATER; 1666 unit->mqtt_flag |= MQTT_FLAG_DATA;
1667 } 1667 }
1668 } 1668 }
1669 } 1669 }
1670 if (unit->door_state) 1670 if (unit->door_state)
1671 device_out(unit->heater_address, unit->heater_state); 1671 device_out(unit->heater_address, unit->heater_state);
1681 int power = round(unit->PID_cool->OutP); 1681 int power = round(unit->PID_cool->OutP);
1682 if (unit->cooler_state != power) { 1682 if (unit->cooler_state != power) {
1683 syslog(LOG_NOTICE, "Unit `%s' cooler %d%% => %d%%", unit->name, unit->cooler_state, power); 1683 syslog(LOG_NOTICE, "Unit `%s' cooler %d%% => %d%%", unit->name, unit->cooler_state, power);
1684 unit->cooler_state = power; 1684 unit->cooler_state = power;
1685 if (unit->cooler_address) 1685 if (unit->cooler_address)
1686 unit->mqtt_flag |= MQTT_FLAG_COOLER; 1686 unit->mqtt_flag |= MQTT_FLAG_DATA;
1687 } 1687 }
1688 } 1688 }
1689 } else { 1689 } else {
1690 if (unit->cooler_wait > 0) { 1690 if (unit->cooler_wait > 0) {
1691 unit->cooler_wait--; 1691 unit->cooler_wait--;
1692 } else { 1692 } else {
1693 if (unit->cooler_state) { 1693 if (unit->cooler_state) {
1694 syslog(LOG_NOTICE, "Unit `%s' cooler On => Off", unit->name); 1694 syslog(LOG_NOTICE, "Unit `%s' cooler On => Off", unit->name);
1695 unit->cooler_state = 0; 1695 unit->cooler_state = 0;
1696 if (unit->cooler_address) 1696 if (unit->cooler_address)
1697 unit->mqtt_flag |= MQTT_FLAG_COOLER; 1697 unit->mqtt_flag |= MQTT_FLAG_DATA;
1698 } 1698 }
1699 } 1699 }
1700 } 1700 }
1701 if (unit->door_state) 1701 if (unit->door_state)
1702 device_out(unit->cooler_address, unit->cooler_state); 1702 device_out(unit->cooler_address, unit->cooler_state);
1718 } else { 1718 } else {
1719 if (! unit->fan_state) { 1719 if (! unit->fan_state) {
1720 syslog(LOG_NOTICE, "Unit `%s' Fan Off => On", unit->name); 1720 syslog(LOG_NOTICE, "Unit `%s' Fan Off => On", unit->name);
1721 unit->fan_state = 100; 1721 unit->fan_state = 100;
1722 if (unit->fan_address) 1722 if (unit->fan_address)
1723 unit->mqtt_flag |= MQTT_FLAG_FAN; 1723 unit->mqtt_flag |= MQTT_FLAG_DATA;
1724 } 1724 }
1725 } 1725 }
1726 } else { 1726 } else {
1727 if (unit->fan_wait > 0) { 1727 if (unit->fan_wait > 0) {
1728 unit->fan_wait--; 1728 unit->fan_wait--;
1729 } else { 1729 } else {
1730 if (unit->fan_state) { 1730 if (unit->fan_state) {
1731 syslog(LOG_NOTICE, "Unit `%s' Fan On => Off", unit->name); 1731 syslog(LOG_NOTICE, "Unit `%s' Fan On => Off", unit->name);
1732 unit->fan_state = 0; 1732 unit->fan_state = 0;
1733 if (unit->fan_address) 1733 if (unit->fan_address)
1734 unit->mqtt_flag |= MQTT_FLAG_FAN; 1734 unit->mqtt_flag |= MQTT_FLAG_DATA;
1735 } 1735 }
1736 } 1736 }
1737 } 1737 }
1738 device_out(unit->fan_address, unit->fan_state); 1738 device_out(unit->fan_address, unit->fan_state);
1739 } 1739 }
1770 LCDspL = unit->prof_target_lo; 1770 LCDspL = unit->prof_target_lo;
1771 LCDspH = unit->prof_target_hi; 1771 LCDspH = unit->prof_target_hi;
1772 } 1772 }
1773 } 1773 }
1774 if ((seconds == 60) && ((unit->mode == UNITMODE_FRIDGE) || (unit->mode == UNITMODE_BEER) || (unit->mode == UNITMODE_PROFILE))) { 1774 if ((seconds == 60) && ((unit->mode == UNITMODE_FRIDGE) || (unit->mode == UNITMODE_BEER) || (unit->mode == UNITMODE_PROFILE))) {
1775 unit->mqtt_flag |= MQTT_FLAG_SP; 1775 unit->mqtt_flag |= MQTT_FLAG_DATA;
1776 } 1776 }
1777 #ifdef HAVE_WIRINGPI_H 1777 #ifdef HAVE_WIRINGPI_H
1778 piLock(LOCK_LCD); 1778 piLock(LOCK_LCD);
1779 #endif 1779 #endif
1780 /* 1780 /*
1913 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0; 1913 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0;
1914 device_out(unit->heater_address, unit->heater_state); 1914 device_out(unit->heater_address, unit->heater_state);
1915 device_out(unit->cooler_address, unit->cooler_state); 1915 device_out(unit->cooler_address, unit->cooler_state);
1916 device_out(unit->fan_address, unit->fan_state); 1916 device_out(unit->fan_address, unit->fan_state);
1917 device_out(unit->light_address, unit->light_state); 1917 device_out(unit->light_address, unit->light_state);
1918 unit->mqtt_flag = MQTT_FLAG_HEATER | MQTT_FLAG_COOLER | MQTT_FLAG_FAN | MQTT_FLAG_LIGHT; 1918 unit->mqtt_flag = MQTT_FLAG_DATA;
1919 publishDData(unit); 1919 publishDData(unit);
1920 syslog(LOG_NOTICE, "Unit `%s' stopped in mode %s", unit->name, UNITMODE[unit->mode]); 1920 syslog(LOG_NOTICE, "Unit `%s' stopped in mode %s", unit->name, UNITMODE[unit->mode]);
1921 } 1921 }
1922 1922
1923 usleep(100000); 1923 usleep(100000);

mercurial