From b48e9fe1fafc7dcc8e2b5b7cb1571f9a0d415386 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Fri, 16 Sep 2022 22:52:24 -0700 Subject: [PATCH] just create empty cspot_config at first boot - release --- components/spotify/Shim.cpp | 2 +- main/esp_app_main.c | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/components/spotify/Shim.cpp b/components/spotify/Shim.cpp index 07d05e8d..99236618 100644 --- a/components/spotify/Shim.cpp +++ b/components/spotify/Shim.cpp @@ -256,7 +256,7 @@ void ShimAudioSink::feedPCMFrames(const uint8_t *data, size_t bytes) { /**************************************************************************************** * NVSFile class to store config */ - bool NVSFile::readFile(std::string filename, std::string &fileContent) { +bool NVSFile::readFile(std::string filename, std::string &fileContent) { auto search = files.find(filename); // cache diff --git a/main/esp_app_main.c b/main/esp_app_main.c index b4844e9f..0343e332 100644 --- a/main/esp_app_main.c +++ b/main/esp_app_main.c @@ -369,17 +369,8 @@ void register_default_nvs(){ register_default_string_val("dhcp_tmout","8"); register_default_string_val("target", CONFIG_TARGET); #ifdef CONFIG_CSPOT_SINK - char * host_hame = config_alloc_get_default(NVS_TYPE_STR, "host_name", NULL, 0); register_default_string_val("enable_cspot", STR(CONFIG_CSPOT_SINK)); - cJSON * cspot_config = cJSON_CreateObject(); - cJSON_AddStringToObject(cspot_config, "deviceName", host_hame); - cJSON_AddNumberToObject(cspot_config, "format", 1); - cJSON_AddNumberToObject(cspot_config, "volume", 32767); - char * cspot_config_str = cJSON_PrintUnformatted(cspot_config); - register_default_string_val("cspot_config", cspot_config_str); - cJSON_Delete(cspot_config); - FREE_AND_NULL(cspot_config_str); - FREE_AND_NULL(host_hame); + register_default_string_val("cspot_config", ""); #endif wait_for_commit(); ESP_LOGD(TAG,"Done setting default values in nvs.");