# HG changeset patch # User Michiel Broek # Date 1427922788 -7200 # Node ID 8f946f9d125a792f9672270a92737d675f125dd0 # Parent 5ff387f4d6b7bd55b4a94100e739a0715a66e42c Added logging of the room temperature. diff -r 5ff387f4d6b7 -r 8f946f9d125a thermferm/logger.c --- a/thermferm/logger.c Wed Apr 01 22:54:27 2015 +0200 +++ b/thermferm/logger.c Wed Apr 01 23:13:08 2015 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2014 + * Copyright (C) 2014-2015 * * Michiel Broek * @@ -30,7 +30,7 @@ { char buf[128], *filename; - snprintf(buf, 127, "Mode,Air,Beer,Target,S_Heater,S_Cooler,S_Fan,S_Door,U_Heater,U_Cooler,U_Fan"); + snprintf(buf, 127, "Mode,Air,Beer,Target,S_Heater,S_Cooler,S_Fan,S_Door,U_Heater,U_Cooler,U_Fan,Room"); filename = xstrcpy(unit); filename = xstrcat(filename, (char *)".log"); logger(filename, buf); diff -r 5ff387f4d6b7 -r 8f946f9d125a thermferm/thermferm.c --- a/thermferm/thermferm.c Wed Apr 01 22:54:27 2015 +0200 +++ b/thermferm/thermferm.c Wed Apr 01 23:13:08 2015 +0200 @@ -834,7 +834,7 @@ int server(void) { char buf[1024], *filename, target[40], heater[40], cooler[40], fan[40], door[40]; - char use_heater[40], use_cooler[40], use_fan[40]; + char use_heater[40], use_cooler[40], use_fan[40], room_temp[40]; time_t now, last = (time_t)0; units_list *unit; profiles_list *profile; @@ -1570,7 +1570,7 @@ snprintf(use_heater, 39, "NA"); snprintf(use_cooler, 39, "NA"); snprintf(use_fan, 39, "NA"); - + snprintf(room_temp, 39, "NA"); if (unit->mode == UNITMODE_BEER) snprintf(target, 39, "%.1f", unit->beer_set); @@ -1594,10 +1594,13 @@ if (unit->door_address) { snprintf(door, 39, "%d", unit->door_state); } + if (Config.temp_address) { + snprintf(room_temp, 39, "%.3f", Config.temp_value / 1000.0); + } - snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s,%s,%s,%s", + snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s,%s,%s,%s,%s", UNITMODE[unit->mode], unit->air_temperature / 1000.0, - unit->beer_temperature / 1000.0, target, heater, cooler, fan, door, use_heater, use_cooler, use_fan); + unit->beer_temperature / 1000.0, target, heater, cooler, fan, door, use_heater, use_cooler, use_fan, room_temp); filename = xstrcpy(unit->name); filename = xstrcat(filename, (char *)".log"); logger(filename, buf);