Batteries implement HTML renderers for status and commands

This commit is contained in:
Jaakko Haakana 2025-06-01 09:59:46 +03:00
parent d1fb28337e
commit 662ae57d2b
48 changed files with 2345 additions and 2020 deletions

View file

@ -0,0 +1,28 @@
#ifndef _ECMP_HTML_H
#define _ECMP_HTML_H
#include "../datalayer/datalayer.h"
#include "../datalayer/datalayer_extended.h"
#include "src/devboard/webserver/BatteryHtmlRenderer.h"
class EcmpHtmlRenderer : public BatteryHtmlRenderer {
public:
String get_status_html() {
String content;
content += "<h4>Main Connector State: ";
if (datalayer_extended.stellantisECMP.MainConnectorState == 0) {
content += "Contactors open</h4>";
} else if (datalayer_extended.stellantisECMP.MainConnectorState == 0x01) {
content += "Precharged</h4>";
} else {
content += "Invalid</h4>";
}
content +=
"<h4>Insulation Resistance: " + String(datalayer_extended.stellantisECMP.InsulationResistance) + "kOhm</h4>";
return content;
}
};
#endif