Skip to content

Commit

Permalink
Fixed bug with schedule & zone 1
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeakes committed Feb 14, 2021
1 parent 3d1e855 commit 53f6e68
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion json_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Binary file modified release/sprinklerd
Binary file not shown.
2 changes: 1 addition & 1 deletion sd_cron.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef SD_VERSION_H
#define SD_VERSION_H

#define SD_VERSION "1.1"
#define SD_VERSION "1.2"

#endif

0 comments on commit 53f6e68

Please sign in to comment.