Clarify BatteryCommand with some documentation

This commit is contained in:
Jaakko Haakana 2025-06-01 13:54:07 +03:00
parent 0eb852997c
commit 17a22dc59d
2 changed files with 4 additions and 0 deletions

View file

@ -5,6 +5,7 @@
#include "../../datalayer/datalayer_extended.h"
#include "../../include.h"
// Available generic battery commands that are taken into use based on what the selected battery supports.
std::vector<BatteryCommand> battery_commands = {
{"clearIsolation", "Clear isolation fault", "clear any active isolation fault?",
[](Battery* b) { return b && b->supports_clear_isolation(); },

View file

@ -15,6 +15,9 @@ String advanced_battery_processor(const String& var);
class Battery;
// Each BatteryCommand defines a command that can be performed by a battery.
// Whether the selected battery supports the command is determined at run-time
// by calling the condition callback.
struct BatteryCommand {
// The unique name of the route in the API to execute the command or a function in Javascript
const char* identifier;