restore user settings first

This commit is contained in:
djnitehawk 2025-03-13 21:39:30 +05:30
parent aa1e7e6e56
commit 49d80fd41d
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,5 @@
using InverterMon.Server.Persistence.Settings;
using InverterMon.Server.Persistence;
using InverterMon.Server.Persistence.Settings;
using InverterMon.Shared.Models;
using SerialPortLib;
@ -13,7 +14,12 @@ public class JkBms
readonly AmpValQueue _recentAmpReadings = new(5); //avg value over 5 readings (~5secs)
readonly SerialPortInput _bms = new();
public JkBms(UserSettings userSettings, IConfiguration config, ILogger<JkBms> logger, IWebHostEnvironment env, IHostApplicationLifetime appLife)
public JkBms(Database _, //essential to restore user settings first
UserSettings userSettings,
IConfiguration config,
ILogger<JkBms> logger,
IWebHostEnvironment env,
IHostApplicationLifetime appLife)
{
if (env.IsDevelopment())
{
@ -130,7 +136,7 @@ public class JkBms
Status.AvgCurrentAmps = 21.444f;
Status.CapacityPct = 50;
Status.PackCapacity = 320;
Status.PackNominalVoltage = 51.2f;
Status.PackNominalVoltage = 48;
Status.IsWarning = false;
Status.TimeHrs = 24;
Status.TimeMins = 10;

View File

@ -1 +1 @@
dotnet publish ./InverterMon.Server.csproj -c Release -r linux-arm64 --self-contained -p:PublishTrimmed=true -p:TrimmerLogLevel=Detailed -o D:\\DOWNLOADS
dotnet publish ./InverterMon.Server.csproj -c Release -r win-x64 --self-contained -p:PublishTrimmed=true -p:TrimmerLogLevel=Detailed -o D:\\DOWNLOADS