mirror of https://github.com/sfeakes/AqualinkD.git
Fix setpoint on pool only
parent
fcb78ffa67
commit
c292be17b7
|
@ -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"
|
||||
|
|
|
@ -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, ¤t_val, trailing);
|
||||
sscanf(aq_data->last_message, "%*[^0123456789]%d", ¤t_val);
|
||||
//sscanf(aq_data->last_message, "%*[^0123456789]%d", ¤t_val);
|
||||
sscanf(&aq_data->last_message[val_len], "%*[^0123456789]%d", ¤t_val);
|
||||
logMessage(LOG_DEBUG, "%s set to %d, looking for %d\n",value_label,current_val,value);
|
||||
|
||||
if(value > current_val) {
|
||||
|
|
|
@ -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.
Loading…
Reference in New Issue