Skip to content

Commit

Permalink
Reboot on config save and remove local hotword settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Romkabouter committed Apr 21, 2021
1 parent 4c2b827 commit dcf5104
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 5 additions & 4 deletions PlatformIO/src/General.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ void loadConfiguration(const char *filename, Config &config) {
config.brightness = doc.getMember("brightness").as<int>();
device->updateBrightness(config.brightness);
config.hotword_brightness = doc.getMember("hotword_brightness").as<int>();
config.hotword_detection = doc.getMember("hotword_detection").as<int>();
//config.hotword_detection = doc.getMember("hotword_detection").as<int>();
config.hotword_detection = 1;
config.volume = doc.getMember("volume").as<int>();
device->setVolume(config.volume);
config.gain = doc.getMember("gain").as<int>();
Expand Down Expand Up @@ -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();
}
3 changes: 3 additions & 0 deletions PlatformIO/src/Satellite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
* ************************************************************************ */

Expand Down
7 changes: 0 additions & 7 deletions PlatformIO/src/index_html.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ input::-moz-focus-inner,input::-moz-focus-outer {border: 0;}
<span class="range-slider__value">0</span>
</div>
</div>
<div class="input-container">
<label for="hotword_detection">Hotword detection:&nbsp;</label>
<select name="hotword_detection">
<option value="0" %HW_LOCAL%>Local</option>
<option value="1" %HW_REMOTE%>Remote</option>
</select>
</div>
<div class="input-container">
<label for="gain">Gain:&nbsp;</label>
<div class="range-slider">
Expand Down

0 comments on commit dcf5104

Please sign in to comment.