From dcf5104deeb3844775678bbc113988b26f0873d5 Mon Sep 17 00:00:00 2001 From: Paul Romkes Date: Wed, 21 Apr 2021 20:25:28 +0200 Subject: [PATCH] Reboot on config save and remove local hotword settings --- PlatformIO/src/General.hpp | 9 +++++---- PlatformIO/src/Satellite.cpp | 3 +++ PlatformIO/src/index_html.h | 7 ------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/PlatformIO/src/General.hpp b/PlatformIO/src/General.hpp index a72168a..51c9385 100644 --- a/PlatformIO/src/General.hpp +++ b/PlatformIO/src/General.hpp @@ -364,7 +364,8 @@ void loadConfiguration(const char *filename, Config &config) { config.brightness = doc.getMember("brightness").as(); device->updateBrightness(config.brightness); config.hotword_brightness = doc.getMember("hotword_brightness").as(); - config.hotword_detection = doc.getMember("hotword_detection").as(); + //config.hotword_detection = doc.getMember("hotword_detection").as(); + config.hotword_detection = 1; config.volume = doc.getMember("volume").as(); device->setVolume(config.volume); config.gain = doc.getMember("gain").as(); @@ -405,9 +406,9 @@ void saveConfiguration(const char *filename, Config &config) { doc["volume"] = config.volume; doc["gain"] = config.gain; if (serializeJson(doc, file) == 0) { - Serial.println(F("Failed to write to file")); + Serial.println(F("Failed to write to file")); } file.close(); - loadConfiguration(filename, config); - audioServer.disconnect(); + Serial.println("Configuration saved! Rebooting"); + ESP.restart(); } \ No newline at end of file diff --git a/PlatformIO/src/Satellite.cpp b/PlatformIO/src/Satellite.cpp index 7c277f7..13fa487 100644 --- a/PlatformIO/src/Satellite.cpp +++ b/PlatformIO/src/Satellite.cpp @@ -87,6 +87,9 @@ - Now scans for strongest AP - Added INMP441 & INMP441MAX98357A - Siteid can now be configured in webui + v7.5.1 + - Saving the configuration now reboots due to instablility issue in disconnecting MQTT + - Remove hotword method from UI and hard setting to REMOTE until local works again * ************************************************************************ */ diff --git a/PlatformIO/src/index_html.h b/PlatformIO/src/index_html.h index 8bd2c44..9b45fa3 100644 --- a/PlatformIO/src/index_html.h +++ b/PlatformIO/src/index_html.h @@ -101,13 +101,6 @@ input::-moz-focus-inner,input::-moz-focus-outer {border: 0;} 0 -
- - -