thermferm/server.c

changeset 274
111b0e9663dc
parent 273
b863e0147296
child 276
a19cc3770f09
--- a/thermferm/server.c	Sun Aug 31 18:25:32 2014 +0200
+++ b/thermferm/server.c	Mon Sep 01 15:43:13 2014 +0200
@@ -1663,24 +1663,31 @@
 				for (i = 0; i < 5; i++) {
 				    if (strcmp(val, PROFSTATE[i]) == 0) {
 					switch (i) {
-						case PROFILE_OFF:	if (unit->prof_state == PROFILE_DONE)
+						case PROFILE_OFF:	if (unit->prof_state == PROFILE_DONE) {
 									    unit->prof_state = PROFILE_OFF;
+									    syslog(LOG_NOTICE, "Profile to OFF via web interface");
+									}
 									break;
-						case PROFILE_PAUSE:	if (unit->prof_state == PROFILE_RUN)
+						case PROFILE_PAUSE:	if (unit->prof_state == PROFILE_RUN) {
 									    unit->prof_state = PROFILE_PAUSE;
-									else if (unit->prof_state == PROFILE_PAUSE)
+									    syslog(LOG_NOTICE, "Profile PAUSE via web interface");
+									} else if (unit->prof_state == PROFILE_PAUSE) {
 									    unit->prof_state = PROFILE_RUN;
+									    syslog(LOG_NOTICE, "Profile RESUME via web interface");
+									}
 									break;
 						case PROFILE_RUN:	if (unit->prof_state == PROFILE_OFF) {
 									    unit->prof_state = PROFILE_RUN;
 									    unit->prof_started = time(NULL);
 									    unit->prof_paused = 0;
+									    syslog(LOG_NOTICE, "Profile to RUN via web interface");
 									}
 									break;
 						case PROFILE_DONE:	break;	/* Command is illegal */
 						case PROFILE_ABORT:	if ((unit->prof_state == PROFILE_RUN) || (unit->prof_state == PROFILE_PAUSE)) {
 									    unit->prof_state = PROFILE_OFF;
 									    unit->prof_started = 0;
+									    syslog(LOG_NOTICE, "Profile ABORT via web interface");
 									}
 									break;
 					}

mercurial