Fixed bug with schedule & zone 1

master v1.3
sfeakes 2021-02-14 10:34:26 -06:00
parent 3d1e855b39
commit 53f6e6874c
4 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ int build_sprinkler_cal_JSON(char* buffer, int size)
for (day=0; day <= 6; day++) {
if (_sdconfig_.cron[day].hour >= 0 && _sdconfig_.cron[day].minute >= 0) {
length += sprintf(buffer+length, ", \"d%d-starttime\" : \"%.2d:%.2d\" ",day,_sdconfig_.cron[day].hour,_sdconfig_.cron[day].minute);
for (zone=1; zone < _sdconfig_.zones; zone ++) {
for (zone=0; zone < _sdconfig_.zones; zone ++) {
if (_sdconfig_.cron[day].zruntimes[zone] >= 0) {
length += sprintf(buffer+length, ", \"d%dz%d-runtime\" : %d",day,zone+1,_sdconfig_.cron[day].zruntimes[zone]);
//logMessage(LOG_DEBUG, "Zone %d, length %d limit %d\n",zone,length,size);

Binary file not shown.

View File

@ -153,7 +153,7 @@ void write_cron() {
//length += sprintf(buffer+length, ", \"d%d-starttime\" : \"%.2d:%.2d\" ",day,_sdconfig_.cron[day].hour,_sdconfig_.cron[day].minute);
min = _sdconfig_.cron[day].minute;
hour = _sdconfig_.cron[day].hour;
for (zone=1; zone < _sdconfig_.zones; zone ++) {
for (zone=0; zone < _sdconfig_.zones; zone ++) {
if (_sdconfig_.cron[day].zruntimes[zone] > 0) {
fprintf(fp, "%d %d * * %d root /usr/bin/curl -s -o /dev/null 'localhost:%s?type=cron&zone=%d&runtime=%d&state=on'\n",min,hour,day,_sdconfig_.socket_port,zone+1,_sdconfig_.cron[day].zruntimes[zone]);
//fprintf(fp, "%d %d * * %d root /usr/bin/curl -s -o /dev/null 'localhost?type=cron&zone=%d&runtime=%d&state=on'\n",min,hour,day,zone+1,_sdconfig_.cron[day].zruntimes[zone]);

View File

@ -1,6 +1,6 @@
#ifndef SD_VERSION_H
#define SD_VERSION_H
#define SD_VERSION "1.1"
#define SD_VERSION "1.2"
#endif