add network device name to sysinfo page
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
|
||||
int mqttConnectionState(); // 0 = not connected; 1 = connected; 2 = connected and mqtt processed
|
||||
bool encryptionSupported();
|
||||
const String networkDeviceName() const;
|
||||
|
||||
const NetworkDeviceType networkDeviceType();
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -17,6 +17,8 @@ public:
|
||||
: _hostname(hostname)
|
||||
{}
|
||||
|
||||
virtual const String deviceName() const = 0;
|
||||
|
||||
virtual void initialize() = 0;
|
||||
virtual ReconnectStatus reconnect() = 0;
|
||||
virtual void reconfigure() = 0;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -18,6 +18,8 @@ public:
|
||||
explicit W5500Device(const String& hostname, Preferences* _preferences, int variant);
|
||||
~W5500Device();
|
||||
|
||||
const String deviceName() const override;
|
||||
|
||||
virtual void initialize();
|
||||
virtual ReconnectStatus reconnect();
|
||||
virtual void reconfigure();
|
||||
|
||||
@@ -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<const char *> wm_menu;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user