Cloud config in config print

This commit is contained in:
Gunnar Skjold
2024-04-05 20:16:43 +02:00
parent 361d3a38ed
commit a19901b58f

View File

@@ -6,6 +6,9 @@
#include "AmsConfiguration.h"
#include "hexutils.h"
#if defined(ESP32)
#include "ESPRandom.h"
#endif
bool AmsConfiguration::getSystemConfig(SystemConfig& config) {
EEPROM.begin(EEPROM_SIZE);
@@ -1291,6 +1294,16 @@ void AmsConfiguration::print(Print* debugger)
debugger->printf_P(PSTR("Language: %s\r\n"), ui.language);
}
CloudConfig cc;
if(getCloudConfig(cc)) {
String uuid = ESPRandom::uuidToString(cc.clientId);;
debugger->println(F("--UI configuration--"));
debugger->printf_P(PSTR("Enabled: %s\r\n"), cc.enabled ? "Yes" : "No");
debugger->printf_P(PSTR("Hostname: %s\r\n"), cc.hostname);
debugger->printf_P(PSTR("Client ID: %s\r\n"), uuid.c_str());
debugger->printf_P(PSTR("Interval: %d\r\n"), cc.interval);
}
debugger->println(F("-----------------------------------------------"));
debugger->flush();
}