Add Log {Led and Message} for Salimax status and alarm

This commit is contained in:
atef 2023-10-04 15:17:43 +02:00
parent 1afcbfbf4f
commit 04bfbfc8b9
2 changed files with 21 additions and 12 deletions

View File

@ -0,0 +1,8 @@
namespace InnovEnergy.App.SaliMax.Ess;
public enum LedState
{
Red,
Orange,
Green
}

View File

@ -131,6 +131,7 @@ internal static class Program
StateMachine = StateMachine.Default,
EssControl = EssControl.Default,
Log = new SystemLog{Led = LedState.Green, Message = null}, //TODO: Put real stuff
Config = Config.Load() // load from disk every iteration, so config can be changed while running
};
}
@ -183,7 +184,7 @@ internal static class Program
record.ControlConstants();
record.ControlSystemState();
$"{DateTime.Now} : {record.StateMachine.State}: {record.StateMachine.Message}".WriteLine().LogInfo();
$"{UnixTime.Now} : {record.StateMachine.State}: {record.StateMachine.Message}".WriteLine().LogInfo();
var essControl = record.ControlEss().WriteLine().LogInfo();