add gpio configuration to sysinfo page
This commit is contained in:
2
Config.h
2
Config.h
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define NUKI_HUB_VERSION "8.21"
|
||||
#define NUKI_HUB_VERSION "8.22-pre-1"
|
||||
|
||||
#define MQTT_QOS_LEVEL 1
|
||||
#define MQTT_CLEAN_SESSIONS false
|
||||
|
||||
6
Gpio.cpp
6
Gpio.cpp
@@ -174,10 +174,8 @@ String Gpio::getRoleDescription(PinRole role) const
|
||||
}
|
||||
}
|
||||
|
||||
void Gpio::getConfigurationText(String& text, const std::vector<PinEntry>& pinConfiguration) const
|
||||
void Gpio::getConfigurationText(String& text, const std::vector<PinEntry>& pinConfiguration, const String& linebreak) const
|
||||
{
|
||||
text.clear();
|
||||
|
||||
for(const auto& entry : pinConfiguration)
|
||||
{
|
||||
if(entry.role != PinRole::Disabled)
|
||||
@@ -190,7 +188,7 @@ void Gpio::getConfigurationText(String& text, const std::vector<PinEntry>& pinCo
|
||||
}
|
||||
text.concat(": ");
|
||||
text.concat(getRoleDescription(entry.role));
|
||||
text.concat("\n\r");
|
||||
text.concat(linebreak);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Gpio.h
2
Gpio.h
@@ -56,7 +56,7 @@ public:
|
||||
const std::vector<PinEntry>& pinConfiguration() const;
|
||||
|
||||
String getRoleDescription(PinRole role) const;
|
||||
void getConfigurationText(String& text, const std::vector<PinEntry>& pinConfiguration) const;
|
||||
void getConfigurationText(String& text, const std::vector<PinEntry>& pinConfiguration, const String& linebreak = "\n") const;
|
||||
|
||||
const std::vector<PinRole>& getAllRoles() const;
|
||||
|
||||
|
||||
@@ -938,6 +938,8 @@ void WebCfgServer::buildInfoHtml(String &response)
|
||||
response.concat(uxTaskGetStackHighWaterMark(presenceDetectionTaskHandle));
|
||||
response.concat("\n");
|
||||
|
||||
_gpio->getConfigurationText(response, _gpio->pinConfiguration());
|
||||
|
||||
response.concat("Restart reason FW: ");
|
||||
response.concat(getRestartReason());
|
||||
response.concat( "\n");
|
||||
|
||||
2
main.cpp
2
main.cpp
@@ -211,7 +211,7 @@ void setup()
|
||||
|
||||
gpio = new Gpio(preferences);
|
||||
String gpioDesc;
|
||||
gpio->getConfigurationText(gpioDesc, gpio->pinConfiguration());
|
||||
gpio->getConfigurationText(gpioDesc, gpio->pinConfiguration(), "\n\r");
|
||||
Serial.print(gpioDesc.c_str());
|
||||
|
||||
Log->println(lockEnabled ? F("NUKI Lock enabled") : F("NUKI Lock disabled"));
|
||||
|
||||
Reference in New Issue
Block a user