show network hostname in webui

This commit is contained in:
Proddy
2024-01-03 23:56:23 +01:00
parent 8384344c5a
commit c9efd095e7
4 changed files with 20 additions and 6 deletions

View File

@@ -19,9 +19,11 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
// see if Ethernet is connected
if (ethernet_connected) {
root["status"] = 10; // custom code #10 - ETHERNET_STATUS_CONNECTED
root["status"] = 10; // custom code #10 - ETHERNET_STATUS_CONNECTED
root["hostname"] = ETH.getHostname();
} else {
root["status"] = (uint8_t)wifi_status;
root["status"] = (uint8_t)wifi_status;
root["hostname"] = WiFi.getHostname();
}
// for both connections show ethernet