Expose TX power adjustment

This commit is contained in:
Gunnar Skjold
2022-01-29 20:34:35 +01:00
parent fb8d9e51a6
commit 5cfb58c2e6
5 changed files with 86 additions and 7 deletions

View File

@@ -514,6 +514,12 @@ void AmsWebServer::configWifiHtml() {
}
html.replace("{h}", wifi.hostname);
html.replace("{m}", wifi.mdns ? "checked" : "");
html.replace("{w}", String(wifi.power / 10.0, 1));
#if defined(ESP32)
html.replace("{wm}", "19.5");
#elif defined(ESP8266)
html.replace("{wm}", "20.5");
#endif
server.setContentLength(html.length() + HEAD_HTML_LEN + FOOT_HTML_LEN);
server.send_P(200, "text/html", HEAD_HTML);
@@ -1187,6 +1193,7 @@ void AmsWebServer::handleSave() {
if(server.hasArg("h") && !server.arg("h").isEmpty()) {
strcpy(wifi.hostname, server.arg("h").c_str());
}
wifi.power = server.arg("w").toFloat() * 10;
config->setWiFiConfig(wifi);
}