diff --git a/Network.cpp b/Network.cpp index 2dd2436b..d059f65d 100644 --- a/Network.cpp +++ b/Network.cpp @@ -479,6 +479,11 @@ bool Network::encryptionSupported() return _device->supportsEncryption(); } +const String Network::networkDeviceName() const +{ + return _device->deviceName(); +} + void Network::publishFloat(const char* prefix, const char* topic, const float value, const uint8_t precision) { char str[30]; diff --git a/Network.h b/Network.h index 73f601a2..f10770ff 100644 --- a/Network.h +++ b/Network.h @@ -45,6 +45,7 @@ class Network int mqttConnectionState(); // 0 = not connected; 1 = connected; 2 = connected and mqtt processed bool encryptionSupported(); + const String networkDeviceName() const; const NetworkDeviceType networkDeviceType(); diff --git a/WebCfgServer.cpp b/WebCfgServer.cpp index 5ea4200d..5660dc6c 100644 --- a/WebCfgServer.cpp +++ b/WebCfgServer.cpp @@ -766,6 +766,10 @@ void WebCfgServer::buildInfoHtml(String &response) response.concat(_nukiOpener->isPaired() ? _nukiOpener->isPinSet() ? "Yes\n" : "No\n" : "-\n"); } + response.concat("Network device: "); + response.concat(_network->networkDeviceName()); + response.concat("\n"); + response.concat("Heap: "); response.concat(esp_get_free_heap_size()); response.concat("\n"); diff --git a/networkDevices/NetworkDevice.h b/networkDevices/NetworkDevice.h index 2d2e19c4..8fc800db 100644 --- a/networkDevices/NetworkDevice.h +++ b/networkDevices/NetworkDevice.h @@ -17,6 +17,8 @@ class NetworkDevice : _hostname(hostname) {} + virtual const String deviceName() const = 0; + virtual void initialize() = 0; virtual ReconnectStatus reconnect() = 0; virtual void reconfigure() = 0; diff --git a/networkDevices/W5500Device.cpp b/networkDevices/W5500Device.cpp index 0822237d..ef0a5316 100644 --- a/networkDevices/W5500Device.cpp +++ b/networkDevices/W5500Device.cpp @@ -32,6 +32,11 @@ W5500Device::W5500Device(const String &hostname, Preferences* preferences, int v W5500Device::~W5500Device() {} +const String W5500Device::deviceName() const +{ + return "Wiznet W5500"; +} + void W5500Device::initialize() { WiFi.mode(WIFI_OFF); diff --git a/networkDevices/W5500Device.h b/networkDevices/W5500Device.h index 7128af43..d6dbd160 100644 --- a/networkDevices/W5500Device.h +++ b/networkDevices/W5500Device.h @@ -18,6 +18,8 @@ class W5500Device : public NetworkDevice explicit W5500Device(const String& hostname, Preferences* _preferences, int variant); ~W5500Device(); + const String deviceName() const override; + virtual void initialize(); virtual ReconnectStatus reconnect(); virtual void reconfigure(); diff --git a/networkDevices/WifiDevice.cpp b/networkDevices/WifiDevice.cpp index 6d014021..1ccaf57d 100644 --- a/networkDevices/WifiDevice.cpp +++ b/networkDevices/WifiDevice.cpp @@ -53,6 +53,11 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences) } } +const String WifiDevice::deviceName() const +{ + return "Built-in Wifi"; +} + void WifiDevice::initialize() { std::vector wm_menu; diff --git a/networkDevices/WifiDevice.h b/networkDevices/WifiDevice.h index 38971495..8d972cb6 100644 --- a/networkDevices/WifiDevice.h +++ b/networkDevices/WifiDevice.h @@ -12,6 +12,8 @@ class WifiDevice : public NetworkDevice public: WifiDevice(const String& hostname, Preferences* _preferences); + const String deviceName() const override; + virtual void initialize(); virtual void reconfigure(); virtual ReconnectStatus reconnect();