mirror of
https://github.com/lumapu/ahoy.git
synced 2025-08-06 09:58:23 +02:00
0.8.102 - 2024-04-01
* fix NTP for `opendtufusion` #1542 * fix scan WiFi in AP mode
This commit is contained in:
parent
2a4c83647a
commit
bcc52c793c
14 changed files with 44 additions and 46 deletions
|
@ -100,7 +100,7 @@ class RestApi {
|
|||
else if(path == "setup") getSetup(request, root);
|
||||
#if !defined(ETHERNET)
|
||||
else if(path == "setup/networks") getNetworks(root);
|
||||
else if(path == "setup/getip") getWifiIp(root);
|
||||
else if(path == "setup/getip") getIp(root);
|
||||
#endif /* !defined(ETHERNET) */
|
||||
else if(path == "live") getLive(request,root);
|
||||
else if (path == "powerHistory") getPowerHistory(request, root);
|
||||
|
@ -891,13 +891,14 @@ class RestApi {
|
|||
|
||||
#if !defined(ETHERNET)
|
||||
void getNetworks(JsonObject obj) {
|
||||
mApp->getAvailNetworks(obj);
|
||||
}
|
||||
void getWifiIp(JsonObject obj) {
|
||||
obj[F("ip")] = mApp->getIp();
|
||||
obj[F("success")] = mApp->getAvailNetworks(obj);
|
||||
}
|
||||
#endif /* !defined(ETHERNET) */
|
||||
|
||||
void getIp(JsonObject obj) {
|
||||
obj[F("ip")] = mApp->getIp();
|
||||
}
|
||||
|
||||
void getLive(AsyncWebServerRequest *request, JsonObject obj) {
|
||||
getGeneric(request, obj.createNestedObject(F("generic")));
|
||||
obj[F("refresh")] = mConfig->inst.sendInterval;
|
||||
|
@ -1031,11 +1032,6 @@ class RestApi {
|
|||
if(isProtected(jsonIn, jsonOut, clientIP))
|
||||
return false;
|
||||
|
||||
#if !defined(ETHERNET)
|
||||
if(F("scan_wifi") == jsonIn[F("cmd")])
|
||||
mApp->scanAvailNetworks();
|
||||
else
|
||||
#endif /* !defined(ETHERNET) */
|
||||
if(F("set_time") == jsonIn[F("cmd")])
|
||||
mApp->setTimestamp(jsonIn[F("val")]);
|
||||
else if(F("sync_ntp") == jsonIn[F("cmd")])
|
||||
|
@ -1049,7 +1045,6 @@ class RestApi {
|
|||
snprintf(mConfig->sys.stationSsid, SSID_LEN, "%s", jsonIn[F("ssid")].as<const char*>());
|
||||
snprintf(mConfig->sys.stationPwd, PWD_LEN, "%s", jsonIn[F("pwd")].as<const char*>());
|
||||
mApp->saveSettings(false); // without reboot
|
||||
//mApp->setStopApAllowedMode(false);
|
||||
mApp->setupStation();
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue