Version 3.0.0

pull/492/head
sfeakes 2025-12-14 12:50:27 -06:00
parent 133836cc7e
commit bf6af8304d
9 changed files with 22 additions and 9 deletions

Binary file not shown.

Binary file not shown.

View File

@ -172,9 +172,12 @@ int save_schedules_js(const char* inBuf, int inSize, char* outBuf, int outSize)
//fclose(fp);
// if we created file, change the permissions
if (!fileexists)
if ( chmod(CRON_FILE, S_IRUSR | S_IWUSR ) < 0 )
if (!fileexists) {
LOG(SCHD_LOG,LOG_NOTICE, "Created %s, setting permissions\n",CRON_FILE);
if ( chmod(CRON_FILE, S_IRUSR | S_IWUSR ) < 0 ) {
LOG(SCHD_LOG,LOG_ERR, "Could not change permissions on cron file %s, scheduling may not work\n",CRON_FILE);
}
}
//remount_root_ro(fs);
aq_close_file(fp, fs);

View File

@ -446,6 +446,7 @@ const char* lightTypeName(clight_type type)
return "unknown";
}
/*
// Used for dynamic config JS
int build_color_lights_js(struct aqualinkdata *aqdata, char* buffer, int size)
{
@ -474,7 +475,8 @@ int build_color_lights_js(struct aqualinkdata *aqdata, char* buffer, int size)
return length;
}
*/
// Used for dynamic config JSON
int build_color_lights_json(struct aqualinkdata *aqdata, char* buffer, int size)
{
memset(&buffer[0], 0, size);
@ -503,6 +505,13 @@ int build_color_lights_json(struct aqualinkdata *aqdata, char* buffer, int size)
buffer[--length] = '\0';
length += sprintf(buffer+length, "}");
length += sprintf(buffer+length, ",\"light_types\": {");
for (i=0; i < NUMBER_LIGHT_COLOR_TYPES; i++) {
length += sprintf(buffer+length, "\"%d\": \"%s\",", i, lightTypeName(i));
}
buffer[--length] = '\0';
length += sprintf(buffer+length, "}");
return length;
}

View File

@ -34,7 +34,7 @@ typedef enum clight_type {
//const char *light_mode_name(clight_type type, int index);
const char *get_currentlight_mode_name(clight_detail light, emulation_type protocol);
const char *light_mode_name(clight_type type, int index, emulation_type protocol);
int build_color_lights_js(struct aqualinkdata *aqdata, char* buffer, int size);
//int build_color_lights_js(struct aqualinkdata *aqdata, char* buffer, int size);
int build_color_lights_json(struct aqualinkdata *aqdata, char* buffer, int size);
int build_color_light_jsonarray(int index, char* buffer, int size);
int dimmer_percent_to_mode_index(int value);

View File

@ -1523,6 +1523,7 @@ int build_aqualink_config_JSON(char* buffer, int size, struct aqualinkdata *aqda
} else if (isPLIGHT(aqdata->aqbuttons[i].special_mask)) {
if (((clight_detail *)aqdata->aqbuttons[i].special_mask_ptr)->lightType >= 0) {
sprintf(buf,"%s_lightMode", prefix);
//if ((result = json_cfg_element(buffer+length, size-length, buf, &((clight_detail *)aqdata->aqbuttons[i].special_mask_ptr)->lightType, CFG_INT, 0, "[\"\", \"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"10\",\"11\"]", 0)) <= 0) {
if ((result = json_cfg_element(buffer+length, size-length, buf, &((clight_detail *)aqdata->aqbuttons[i].special_mask_ptr)->lightType, CFG_INT, 0, NULL, 0)) <= 0) {
LOG(NET_LOG,LOG_ERR, "Config json buffer full in, result truncated! size=%d curently used=%d\n",size,length);
return length;

View File

@ -28,6 +28,7 @@
#define WEBCONFIGFILE "/config.json"
void fprintf_json(FILE *fp,const char *json_string);
/*
// This should be called dynamic web config, not webconfig to avoid confusion.
int build_dynamic_webconfig_js(struct aqualinkdata *aqdata, char* buffer, int size)
{
@ -40,6 +41,7 @@ int build_dynamic_webconfig_js(struct aqualinkdata *aqdata, char* buffer, int si
return length;
}
*/
int build_dynamic_webconfig_json(struct aqualinkdata *aqdata, char* buffer, int size)
{

View File

@ -3,7 +3,7 @@
int build_dynamic_webconfig_js(struct aqualinkdata *aqdata, char* buffer, int size);
//int build_dynamic_webconfig_js(struct aqualinkdata *aqdata, char* buffer, int size);
int build_dynamic_webconfig_json(struct aqualinkdata *aqdata, char* buffer, int size);
int save_web_config_json(const char* inBuf, int inSize, char* outBuf, int outSize, struct aqualinkdata *aqdata);

View File

@ -256,8 +256,8 @@
padding: 5px;
height: var(--tile-width);
width: var(--tile-width);
filter: opacity(90%);
opacity: 0.9;
filter: opacity(95%);
opacity: 0.95;
}
.on {
@ -749,8 +749,6 @@
var _config = {};
var _dynamicconfig = {};
//'{"enable_schedules" : "false","light_programs": {"0":[], '
var _aq_display_tile_size = 'small';