Add battery heating Current
This commit is contained in:
parent
bd24a725c6
commit
b37fd90098
|
@ -36,7 +36,7 @@ public class AmptDevices
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
Console.WriteLine( "Failed to read Ampt data \n"+ e.Message );
|
||||
// TODO: log
|
||||
}
|
||||
|
||||
|
|
|
@ -18,13 +18,11 @@ public class Battery48TlDevices
|
|||
|
||||
return new Battery48TlRecords(records);
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
//Console.WriteLine(e);
|
||||
Console.WriteLine( "Failed to read Battery data \n"+ e.Message );
|
||||
// TODO: log
|
||||
|
||||
"Failed to read Battery data".WriteLine();
|
||||
|
||||
return Battery48TlRecords.Null;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ public class Battery48TlRecords
|
|||
Alarms = records.SelectMany(r => r.Alarms).Distinct().ToList();
|
||||
Soc = empty ? 0 : records.Min(r => r.Soc.Value);
|
||||
Temperature = records.Any() ? records.Average(b => b.Temperatures.Cells.Average.Value) : 0;
|
||||
HeatingCurrent = records.Any() ? records.Sum(b => b.HeatingCurrent) : 0;
|
||||
|
||||
Dc = empty
|
||||
? DcBus.FromVoltageCurrent(0, 0)
|
||||
|
@ -31,6 +32,7 @@ public class Battery48TlRecords
|
|||
public IReadOnlyList<String> Alarms { get; init; }
|
||||
public Percent Soc { get; init; }
|
||||
public Temperature Temperature { get; init; }
|
||||
public Current HeatingCurrent { get; init; }
|
||||
|
||||
public IReadOnlyList<Battery48TlRecord> Devices { get; init; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue