Fix setpoint on pool only

pull/42/head
shaun feakes 2018-09-20 18:30:09 -05:00
parent fcb78ffa67
commit c292be17b7
5 changed files with 7 additions and 3 deletions

View File

@ -13,6 +13,7 @@
#define SWG_TOPIC "SWG"
#define SWG_PPM_TOPIC SWG_TOPIC "/PPM"
#define SWG_PPM_F_TOPIC SWG_TOPIC "/PPM_f"
#define SWG_ENABELED_TOPIC SWG_TOPIC ENABELED_SUBT
#define SWG_PERCENT_TOPIC SWG_TOPIC "/Percent"
#define SWG_PERCENT_F_TOPIC SWG_TOPIC "/Percent_f"

View File

@ -345,11 +345,12 @@ bool setAqualinkNumericField_new(struct aqualinkdata *aq_data, char *value_label
{
logMessage(LOG_DEBUG,"Setting menu item '%s' to %d\n",value_label, value);
//char leading[10]; // description of the field (POOL, SPA, FRZ)
int current_val; // integer value of the current set point
int current_val=-1; // integer value of the current set point
//char trailing[10]; // the degrees and scale
char searchBuf[20];
sprintf(searchBuf, "^%s", value_label);
int val_len = strlen(value_label);
int i=0;
do
{
@ -360,7 +361,8 @@ bool setAqualinkNumericField_new(struct aqualinkdata *aq_data, char *value_label
}
//logMessage(LOG_DEBUG,"WAITING for kick value=%d\n",current_val);
//sscanf(aq_data->last_message, "%s %d%s", leading, &current_val, trailing);
sscanf(aq_data->last_message, "%*[^0123456789]%d", &current_val);
//sscanf(aq_data->last_message, "%*[^0123456789]%d", &current_val);
sscanf(&aq_data->last_message[val_len], "%*[^0123456789]%d", &current_val);
logMessage(LOG_DEBUG, "%s set to %d, looking for %d\n",value_label,current_val,value);
if(value > current_val) {

View File

@ -358,6 +358,7 @@ void mqtt_broadcast_aqualinkstate(struct mg_connection *nc)
if (_aqualink_data->swg_ppm != TEMP_UNKNOWN && ( force_update || _aqualink_data->swg_ppm != _last_mqtt_aqualinkdata.swg_ppm)) {
_last_mqtt_aqualinkdata.swg_ppm = _aqualink_data->swg_ppm;
send_mqtt_numeric_msg(nc, SWG_PPM_TOPIC, _aqualink_data->swg_ppm);
send_mqtt_numeric_msg(nc, SWG_PPM_F_TOPIC, roundf(degFtoC(_aqualink_data->swg_ppm)));
send_domoticz_mqtt_numeric_msg(nc, _aqualink_config->dzidx_swg_ppm, _aqualink_data->swg_ppm);
}
}

Binary file not shown.

View File

@ -1,4 +1,4 @@
#define AQUALINKD_NAME "Aqualink Daemon"
#define AQUALINKD_VERSION "1.2.2"
#define AQUALINKD_VERSION "1.2.2a"