22 lines
796 B
C++
22 lines
796 B
C++
#include <Arduino.h>
|
|
#include "HTMLGenerator.h"
|
|
#include "DebugLog.h"
|
|
|
|
const String HTMLGenerator::GetElement(const String &tag, const String &content)
|
|
{
|
|
return "<" + tag + ">" + content + "</" + tag + ">";
|
|
}
|
|
|
|
const String HTMLGenerator::DisplayOuputPinStatus(const String &pinName, const bool &isOn, const String &description)
|
|
{
|
|
const String pinvariable = pinName + (isOn ? "=OFF" : "=ON");
|
|
String content = pinName + " is " + (isOn ? "ON" : "OFF") + " | <a href=\"" + pinvariable + "\">" + pinvariable + "</a> ";
|
|
return GetElement("p", content);
|
|
}
|
|
|
|
const String HTMLGenerator::DisplayInputPinStatus(const String &pinName, const bool &isOn, const String &description)
|
|
{
|
|
const String content = pinName + " is " + (isOn ? "ON" : "OFF");
|
|
return GetElement("H4", content);
|
|
}
|