From 5e441f3e5d23d28fcf79faad12b58ad8b916586a Mon Sep 17 00:00:00 2001 From: SciLor Date: Mon, 29 Apr 2024 17:29:31 +0000 Subject: [PATCH] boxModel instead of color id. --- include/settings.h | 2 +- src/handler_api.c | 2 +- src/settings.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/settings.h b/include/settings.h index f60261ba..4eda1eee 100644 --- a/include/settings.h +++ b/include/settings.h @@ -280,7 +280,7 @@ typedef struct uint32_t configVersion; char *commonName; char *boxName; - char *boxColorId; + char *boxModel; settings_core_t core; settings_cloud_t cloud; settings_encode_t encode; diff --git a/src/handler_api.c b/src/handler_api.c index 6f84b7bc..f2ccd579 100644 --- a/src/handler_api.c +++ b/src/handler_api.c @@ -315,7 +315,7 @@ error_t handleApiGetBoxes(HttpConnection *connection, const char_t *uri, const c cJSON_AddStringToObject(jsonEntry, "ID", settings->internal.overlayUniqueId); cJSON_AddStringToObject(jsonEntry, "commonName", settings->commonName); cJSON_AddStringToObject(jsonEntry, "boxName", settings->boxName); - cJSON_AddStringToObject(jsonEntry, "boxColorId", settings->boxColorId); // TODO add color name + url + cJSON_AddStringToObject(jsonEntry, "boxModel", settings->boxModel); // TODO add color name + url cJSON_AddItemToArray(jsonArray, jsonEntry); } diff --git a/src/settings.c b/src/settings.c index 93f893c8..1bec5192 100644 --- a/src/settings.c +++ b/src/settings.c @@ -43,7 +43,7 @@ static void option_map_init(uint8_t settingsId) OPTION_INTERNAL_UNSIGNED("configVersion", &settings->configVersion, 0, 0, 255, "Config version") OPTION_INTERNAL_STRING("commonName", &settings->commonName, "default", "common name of the certificate (for overlays)") OPTION_INTERNAL_STRING("boxName", &settings->boxName, "Toniebox", "Name of the box") - OPTION_INTERNAL_STRING("boxColorId", &settings->boxColorId, "", "Color ID of the box") + OPTION_INTERNAL_STRING("boxModel", &settings->boxModel, "", "Model of the box") OPTION_TREE_DESC("log", "Logging") OPTION_UNSIGNED("log.level", &settings->log.level, 4, 0, 6, "Loglevel", "0=off - 6=verbose") @@ -362,7 +362,7 @@ settings_t *get_settings_cn(const char *commonName) settings_set_string_id("commonName", boxId, i); settings_set_string_id("internal.overlayUniqueId", boxId, i); settings_set_string_id("boxName", boxName, i); - settings_set_string_id("boxColorId", "", i); + settings_set_string_id("boxModel", "", i); settings_get_by_name_id("core.client_cert.file.crt", i)->overlayed = true; settings_get_by_name_id("core.client_cert.file.key", i)->overlayed = true; Settings_Overlay[i].internal.config_used = true; @@ -662,7 +662,7 @@ error_t settings_save_ovl(bool overlay) while (option_map[pos].type != TYPE_END) { setting_item_t *opt = &option_map[pos]; - if (!opt->internal || !osStrcmp(opt->option_name, "configVersion") || (overlay && (!osStrcmp(opt->option_name, "commonName") || !osStrcmp(opt->option_name, "boxName") || !osStrcmp(opt->option_name, "boxColorId")))) + if (!opt->internal || !osStrcmp(opt->option_name, "configVersion") || (overlay && (!osStrcmp(opt->option_name, "commonName") || !osStrcmp(opt->option_name, "boxName") || !osStrcmp(opt->option_name, "boxModel")))) { char *overlayPrefix; if (overlay)