Skip to content

Commit

Permalink
boxModel instead of color id.
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Apr 29, 2024
1 parent 348756b commit 5e441f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/handler_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5e441f3

Please sign in to comment.