Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeakes committed Dec 7, 2024
1 parent fd3c64b commit 32f1aac
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
Binary file added release/aqualinkd-amd64
Binary file not shown.
Binary file modified release/aqualinkd-arm64
Binary file not shown.
Binary file modified release/aqualinkd-armhf
Binary file not shown.
Binary file added release/serial_logger-amd64
Binary file not shown.
5 changes: 4 additions & 1 deletion source/allbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ void _processMessage(char *message, struct aqualinkdata *aq_data, bool reset)
//static int boost_msg_count = 0;
static int16_t msg_loop = 0;
static aqledstate default_frz_protect_state = OFF;
static bool boostInLastLoop = false;
// NSF replace message with msg
#ifdef AQ_RS16
int16_t rs16;
Expand Down Expand Up @@ -284,14 +285,15 @@ void _processMessage(char *message, struct aqualinkdata *aq_data, bool reset)
}
*/
if ((msg_loop & MSG_BOOST) != MSG_BOOST) {
if (aq_data->boost == true) {
if (aq_data->boost == true || boostInLastLoop == true) {
LOG(ALLB_LOG,LOG_INFO, "Boost turned off\n");
event_happened_set_device_state(AQS_BOOST_OFF, aq_data);
// Add code to check Pump if to turn it on (was scheduled) ie time now is inbetween ON / OFF schedule
}
aq_data->boost = false;
aq_data->boost_msg[0] = '\0';
aq_data->boost_duration = 0;
boostInLastLoop = false;
//if (aq_data->swg_percent >= 101)
// aq_data->swg_percent = 0;
}
Expand Down Expand Up @@ -578,6 +580,7 @@ void _processMessage(char *message, struct aqualinkdata *aq_data, bool reset)
aq_data->boost = true;
msg_loop |= MSG_BOOST;
msg_loop |= MSG_SWG;
boostInLastLoop = true;
//convert_boost_to_duration(aq_data->boost_msg)
//if (aq_data->ar_swg_status != SWG_STATUS_ON) {aq_data->ar_swg_status = SWG_STATUS_ON;}
if (aq_data->swg_percent != 101) {changeSWGpercent(aq_data, 101);}
Expand Down
10 changes: 7 additions & 3 deletions source/aq_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ int build_schedules_js(char* buffer, int size)
// Group 9 is URL
// Group 10 is value
if (groupArray[8].rm_so == (size_t)-1) {
LOG(SCHD_LOG,LOG_ERR, "No matching information from cron file\n");
if (size > 0) {
LOG(SCHD_LOG,LOG_ERR, "No matching information from cron file\n");
}
} else {
cline.enabled = (line[groupArray[1].rm_so] == '#')?false:true;
sprintf(cline.minute, "%.*s", (groupArray[2].rm_eo - groupArray[2].rm_so), (line + groupArray[2].rm_so));
Expand All @@ -268,8 +270,8 @@ int build_schedules_js(char* buffer, int size)
sprintf(cline.dayw, "%.*s", (groupArray[6].rm_eo - groupArray[6].rm_so), (line + groupArray[6].rm_so));
sprintf(cline.url, "%.*s", (groupArray[9].rm_eo - groupArray[9].rm_so), (line + groupArray[9].rm_so));
sprintf(cline.value, "%.*s", (groupArray[10].rm_eo - groupArray[10].rm_so), (line + groupArray[10].rm_so));
LOG(SCHD_LOG,LOG_INFO, "Read from cron. Enabled:%d Min:%s Hour:%s DayM:%s Month:%s DayW:%s URL:%s Value:%s\n",cline.enabled,cline.minute,cline.hour,cline.daym,cline.month,cline.dayw,cline.url,cline.value);
if (size > 0) {
LOG(SCHD_LOG,LOG_INFO, "Read from cron. Enabled:%d Min:%s Hour:%s DayM:%s Month:%s DayW:%s URL:%s Value:%s\n",cline.enabled,cline.minute,cline.hour,cline.daym,cline.month,cline.dayw,cline.url,cline.value);
length += sprintf(buffer+length, "{\"enabled\":\"%d\", \"min\":\"%s\",\"hour\":\"%s\",\"daym\":\"%s\",\"month\":\"%s\",\"dayw\":\"%s\",\"url\":\"%s\",\"value\":\"%s\"},",
cline.enabled,
cline.minute,
Expand Down Expand Up @@ -300,7 +302,9 @@ int build_schedules_js(char* buffer, int size)
}
}
} else {
LOG(SCHD_LOG,LOG_DEBUG, "regexp no match (%d) %s\n", rc, line);
if (size > 0) {
LOG(SCHD_LOG,LOG_DEBUG, "regexp no match (%d) %s", rc, line);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/aq_scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef struct aqs_cron

int build_schedules_js(char* buffer, int size);
int save_schedules_js(const char* inBuf, int inSize, char* outBuf, int outSize);

void get_cron_pump_times();

#define AQS_PUMP_URL BTN_PUMP "/set"

Expand Down

0 comments on commit 32f1aac

Please sign in to comment.