New config UI for Services (Airplay, bt, etc) - release

This commit is contained in:
Sebastien
2020-09-12 23:09:38 -04:00
parent bbbc924fcd
commit 0c224b4b84
5 changed files with 10 additions and 8 deletions

View File

@@ -237,7 +237,7 @@ void monitor_svc_init(void) {
monitor_timer = xTimerCreate("monitor", MONITOR_TIMER / portTICK_RATE_MS, pdTRUE, NULL, monitor_callback); monitor_timer = xTimerCreate("monitor", MONITOR_TIMER / portTICK_RATE_MS, pdTRUE, NULL, monitor_callback);
xTimerStart(monitor_timer, portMAX_DELAY); xTimerStart(monitor_timer, portMAX_DELAY);
} }
free(p); FREE_AND_NULL(p);
ESP_LOGI(TAG, "Heap internal:%zu (min:%zu) external:%zu (min:%zu)", ESP_LOGI(TAG, "Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
heap_caps_get_free_size(MALLOC_CAP_INTERNAL), heap_caps_get_free_size(MALLOC_CAP_INTERNAL),

View File

@@ -1243,8 +1243,9 @@ function getCommands() {
} }
function getConfig() { function getConfig() {
$.getJSON("/config.json", function(data) { $.getJSON("/config.json", function(entries) {
Object.keys(data.hasOwnProperty('config') ? data.config : data).sort().forEach(function(key, i) { data = entries.hasOwnProperty('config') ? entries.config : entries;
Object.keys(data).sort().forEach(function(key, i) {
if (data.hasOwnProperty(key)) { if (data.hasOwnProperty(key)) {
if (key == 'autoexec') { if (key == 'autoexec') {
if (data["autoexec"].value === "1") { if (data["autoexec"].value === "1") {
@@ -1280,9 +1281,9 @@ function getConfig() {
} }
}); });
$("tbody#nvsTable").append("<tr><td><input type='text' class='form-control' id='nvs-new-key' placeholder='new key'></td><td><input type='text' class='form-control' id='nvs-new-value' placeholder='new value' nvs_type=33 ></td></tr>"); $("tbody#nvsTable").append("<tr><td><input type='text' class='form-control' id='nvs-new-key' placeholder='new key'></td><td><input type='text' class='form-control' id='nvs-new-value' placeholder='new value' nvs_type=33 ></td></tr>");
if (data.hasOwnProperty('gpio')) { if (entries.hasOwnProperty('gpio')) {
data.gpio.forEach(function(gpio_entry) { entries.gpio.forEach(function(gpio_entry) {
cl = gpio_entry.fixed ? "table-light" : "table-dark"; cl = gpio_entry.fixed ? "table-secondary" : "table-primary";
$("tbody#gpiotable").append('<tr class=' + cl + '><th scope="row">' + gpio_entry.group + '</th><td>' + gpio_entry.name + '</td><td>' + gpio_entry.gpio + '</td><td>' + (gpio_entry.fixed ? 'Fixed':'Configuration') + '</td></tr>'); $("tbody#gpiotable").append('<tr class=' + cl + '><th scope="row">' + gpio_entry.group + '</th><td>' + gpio_entry.name + '</td><td>' + gpio_entry.gpio + '</td><td>' + (gpio_entry.fixed ? 'Fixed':'Configuration') + '</td></tr>');
}); });
} }

View File

@@ -207,6 +207,7 @@
</div> </div>
<!-- wifi --> <!-- wifi -->
<div class="tab-pane fade" id="tab-setdisplay"> <div class="tab-pane fade" id="tab-setdisplay">
<div id="set_services-list"></div>
<div id="setname-list"></div> <div id="setname-list"></div>
<div id="setdisplay-list"></div> <div id="setdisplay-list"></div>
<div id="i2cconfig-list"></div> <div id="i2cconfig-list"></div>

File diff suppressed because one or more lines are too long

View File

@@ -274,7 +274,7 @@ void wifi_manager_init_wifi(){
ESP_LOGD(TAG, "Initializing wifi. Starting wifi"); ESP_LOGD(TAG, "Initializing wifi. Starting wifi");
char * disable_ps = config_alloc_get_default(NVS_TYPE_STR, "disable_ps", "n", 0); char * disable_ps = config_alloc_get_default(NVS_TYPE_STR, "disable_ps", "n", 0);
if (gpio36_39_used || (disable_ps && strcasecmp(disable_ps,"y"))) { if (gpio36_39_used || (disable_ps && strcasecmp(disable_ps,"y")==0)) {
if(gpio36_39_used){ if(gpio36_39_used){
ESP_LOGW(TAG, "GPIO 36 or 39 are in use, need to disable WiFi PowerSave!"); ESP_LOGW(TAG, "GPIO 36 or 39 are in use, need to disable WiFi PowerSave!");
} }