Add the apply function to the local config file

This commit is contained in:
atef 2023-12-04 14:14:11 +01:00
parent 3b02b46b78
commit 3a0c96fe23
1 changed files with 8 additions and 1 deletions

View File

@ -250,6 +250,8 @@ internal static class Program
(record.Relays is null ? "No relay Data available" : record.Relays.FiWarning ? "Alert: Fi Warning Detected" : "No Fi Warning Detected").WriteLine(); (record.Relays is null ? "No relay Data available" : record.Relays.FiWarning ? "Alert: Fi Warning Detected" : "No Fi Warning Detected").WriteLine();
(record.Relays is null ? "No relay Data available" : record.Relays.FiError ? "Alert: Fi Error Detected" : "No Fi Error Detected") .WriteLine(); (record.Relays is null ? "No relay Data available" : record.Relays.FiError ? "Alert: Fi Error Detected" : "No Fi Error Detected") .WriteLine();
record.ApplyConfigFile(minSoc:22, gridSetPoint:1);
record.Config.Save(); record.Config.Save();
"===========================================".LogInfo(); "===========================================".LogInfo();
@ -734,7 +736,12 @@ internal static class Program
return value == "/Battery/Dc/Power"; return value == "/Battery/Dc/Power";
} }
private static void ApplyConfigFile(this StatusRecord status, Double minSoc, Double gridSetPoint)
{
status.Config.MinSoc = minSoc;
status.Config.GridSetPoint = gridSetPoint;
}
// Method to calculate average for a variableValue in a dictionary // Method to calculate average for a variableValue in a dictionary
static double CalculateAverage( List<Double> data) static double CalculateAverage( List<Double> data)
{ {