pull/373/head v2.5.1
sfeakes 2024-12-07 12:50:00 -06:00
parent fd3c64b9c2
commit 32f1aac02e
7 changed files with 12 additions and 5 deletions

BIN
release/aqualinkd-amd64 Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
release/serial_logger-amd64 Executable file

Binary file not shown.

View File

@ -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;
@ -284,7 +285,7 @@ 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
@ -292,6 +293,7 @@ void _processMessage(char *message, struct aqualinkdata *aq_data, bool reset)
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;
}
@ -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);}

View File

@ -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));
@ -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,
@ -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);
}
}
}

View File

@ -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"