CLeanup
All checks were successful
Test compiling project / test (push) Successful in 1m45s

This commit is contained in:
2024-12-17 22:59:49 +01:00
parent 31bc4cf5cf
commit d212216c26
5 changed files with 40 additions and 30 deletions

View File

@@ -1,6 +1,10 @@
#include <Arduino.h>
#include "tools.h"
#include <ArduinoLog.h>
#include "../global_data/defines.h"
#include <Preferences.h>
extern Preferences prefs;
void printSuffix(Print* _logOutput, int logLevel)
{
@@ -18,4 +22,19 @@ void print_prefix(Print* _logOutput, int logLevel)
bool is_error(ActiveErrors active_errors) {
return active_errors.current_high || active_errors.current_low || active_errors.level_high || active_errors.level_low || active_errors.voltage_high || active_errors.voltage_low;
}
String processor(const String& var)
{
if (var == level_sensor_range_key) {
return String(prefs.getFloat(level_sensor_range_key, -1));
} else if (var == water_level_min_key) {
return String(prefs.getFloat(water_level_min_key, -1));
} else if (var == water_level_max_key) {
return String(prefs.getFloat(water_level_max_key, -1));
} else if (var == water_volume_key) {
return String(prefs.getFloat(water_volume_key, -1));
}
return String("Test");
}