diff --git a/README.md b/README.md index c59a67c..b36199b 100644 --- a/README.md +++ b/README.md @@ -115,31 +115,6 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control * The only Jandy devices I have not decoded yet are LX heater & Chemical Feeder. If you have either of these devices and are willing to post some logs, please let me know, or post in the [Discussions area](https://github.com/aqualinkd/AqualinkD/discussions) - -


@@ -153,6 +128,20 @@ AqualinkD will be moving over to github hosted runners for compiling, currently

+ + + +# Updates in 3.0.2 +* Fixed bug with SWG being enabled if one is not present. +* Fixed bug with light_programs ending in 'show' aqualinkd.conf + + # Updates in 3.0.1 * UI Update for web config. * UI Now support for themes. (auto, dark, light -or- custom) diff --git a/release/aqualinkd-arm64 b/release/aqualinkd-arm64 index 40c67a4..cb1ddc8 100755 Binary files a/release/aqualinkd-arm64 and b/release/aqualinkd-arm64 differ diff --git a/release/aqualinkd-armhf b/release/aqualinkd-armhf index adadc96..b2ebda0 100755 Binary files a/release/aqualinkd-armhf and b/release/aqualinkd-armhf differ diff --git a/source/allbutton.c b/source/allbutton.c index 894c84d..8f699b3 100644 --- a/source/allbutton.c +++ b/source/allbutton.c @@ -259,12 +259,13 @@ void _processMessage(char *message, struct aqualinkdata *aqdata, bool reset) // Removed aqdata->swg_led_state check from below if, so SWG can be found if read_SWG_rs584 is off. // May want to add options like (isIAQT_ENABLED == false && isONET_ENABLED == false && READ_RSDEV_SWG == false ) // Then remove the aqdata->swg_led_state check - if ( ((msg_loop & MSG_SWG_DEVICE) != MSG_SWG_DEVICE) /*&& aqdata->swg_led_state != LED_S_UNKNOWN*/) { + if ( ((msg_loop & MSG_SWG_DEVICE) != MSG_SWG_DEVICE) && aqdata->swg_led_state != LED_S_UNKNOWN) { // No Additional SWG devices messages like "no flow" - if ((msg_loop & MSG_SWG) != MSG_SWG && aqdata->aqbuttons[PUMP_INDEX].led->state == OFF ) + if ((msg_loop & MSG_SWG) != MSG_SWG && aqdata->aqbuttons[PUMP_INDEX].led->state == OFF ) { setSWGdeviceStatus(aqdata, ALLBUTTON, SWG_STATUS_OFF); - else + } else { setSWGdeviceStatus(aqdata, ALLBUTTON, SWG_STATUS_ON); + } } // If no AQUAPURE message, either (no SWG, it's set 0, or it's off). @@ -504,6 +505,11 @@ void _processMessage(char *message, struct aqualinkdata *aqdata, bool reset) } else if (strncasecmp(msg, MSG_SWG_PPM, MSG_SWG_PPM_LEN) == 0) { + // if we see PPM message, we must have a SWG, so set the status to on, if it's unknown. + // This will enable SWG without read_rs485_swg set + if (aqdata->swg_led_state == LED_S_UNKNOWN) { + setSWGdeviceStatus(aqdata, ALLBUTTON, SWG_STATUS_ON); + } SET_IF_CHANGED( aqdata->swg_ppm, atoi(msg + MSG_SWG_PPM_LEN), aqdata->is_dirty); msg_loop |= MSG_SWG; } diff --git a/source/color_lights.c b/source/color_lights.c index 371e323..a0478c6 100644 --- a/source/color_lights.c +++ b/source/color_lights.c @@ -156,6 +156,10 @@ char *_color_light_options[NUMBER_LIGHT_COLOR_TYPES][LIGHT_COLOR_OPTIONS] = // DON'T FORGET TO CHANGE #define DIMMER_LIGHT_INDEX 10 in color_lights.h +int _custom_shows = 0; +char *_color_light_custom_show_names[LIGHT_COLOR_OPTIONS]; + + /* void deleteLightOption(int type, int index) @@ -210,6 +214,9 @@ void clear_aqualinkd_light_modes() //_color_light_options[0][i] = i; //_color_light_options[0][i] = _aqualinkd_custom_colors[i]; } + + // Reset the show list + _custom_shows = 0; } int get_num_light_modes(int index) @@ -240,6 +247,15 @@ bool set_aqualinkd_light_mode_name(char *name, int index, bool isShow) // TODO NSF check isShow and add a custom one if needed _color_light_options[0][index] = name; + if (isShow) { + //printf ("ADDED Show %s and index %d\n",name,_custom_shows); + if (_custom_shows < LIGHT_COLOR_OPTIONS ) { + _color_light_custom_show_names[_custom_shows++] = name; + } else { + LOG(AQUA_LOG,LOG_WARNING, "Config error, max custom light mode shows is %d \n",LIGHT_COLOR_OPTIONS); + } + } + return true; } @@ -337,6 +353,15 @@ bool isShowMode(const char *mode) if (mode == NULL) return false; + for (int i=0; i < _custom_shows; i++) { + // We could probably simplify this by simply checking the pointers and not using strcmp + // if ( _color_light_custom_show_names[i] == mode ) + if (_color_light_custom_show_names[i] != NULL && + strcmp(mode, _color_light_custom_show_names[i]) == 0) { + return true; + } + } + if (strcmp(mode, "Color Splash") == 0 || strcmp(mode, "Slow Splash") == 0 || strcmp(mode, "Fast Splash") == 0 || diff --git a/source/config.c b/source/config.c index 630fd18..dd134cf 100644 --- a/source/config.c +++ b/source/config.c @@ -1055,13 +1055,25 @@ if (strlen(cleanwhitespace(value)) <= 0) { } char *name = cleanalloc(value); int len = strlen(name); + char *end = NULL; if (len > 0) { + //printf("%s\n",name); + if ((end = strstr(name, " - show")) != NULL) { + name[end-name] = '\0'; + set_aqualinkd_light_mode_name(name,num,true); + //printf("Index Added SHOW '%s'\n",name); + } else { + set_aqualinkd_light_mode_name(name,num,false); + //printf("Added light '%s'\n",name); + } + /* if ( strncasecmp(name+len-7, " - show", 7) == 0 ) { name[len-7] = '\0'; set_aqualinkd_light_mode_name(name,num,true); } else { set_aqualinkd_light_mode_name(name,num,false); } + */ rtn=true; } else { LOG(AQUA_LOG,LOG_WARNING, "Config error, light_program_%d is blank\n",num); diff --git a/source/version.h b/source/version.h index 718978b..50e19da 100644 --- a/source/version.h +++ b/source/version.h @@ -4,5 +4,5 @@ #define AQUALINKD_SHORT_NAME "AqualinkD" // Use Magor . Minor . Patch -#define AQUALINKD_VERSION "3.0.1" +#define AQUALINKD_VERSION "3.0.2" \ No newline at end of file diff --git a/web/config.json b/web/config.json index bb094b5..52bc117 100644 --- a/web/config.json +++ b/web/config.json @@ -152,9 +152,6 @@ "CHEM/ORP": { "display": "true" }, - "Solar_Heater": { - "display": "true" - }, "Extra_Aux": { "display": "true" },