From 508b03a0be985ee6683b46d5c9e83521a1e6c794 Mon Sep 17 00:00:00 2001 From: Torsten Oltmanns Date: Sun, 10 Nov 2024 12:30:40 +0800 Subject: [PATCH] fixed aggregated SOC value --- .../java/com/airepublic/bmstoinverter/core/Inverter.java | 5 +++++ .../bmstoinverter/core/util/{Util.java => BitUtil.java} | 0 2 files changed, 5 insertions(+) rename core-api/src/main/java/com/airepublic/bmstoinverter/core/util/{Util.java => BitUtil.java} (100%) diff --git a/core-api/src/main/java/com/airepublic/bmstoinverter/core/Inverter.java b/core-api/src/main/java/com/airepublic/bmstoinverter/core/Inverter.java index 056e0fec..0448f493 100644 --- a/core-api/src/main/java/com/airepublic/bmstoinverter/core/Inverter.java +++ b/core-api/src/main/java/com/airepublic/bmstoinverter/core/Inverter.java @@ -100,6 +100,10 @@ public String getPortLocator() { * @return the {@link EnergyStorage} */ public EnergyStorage getEnergyStorage() { + if (energyStorage == null) { + energyStorage = new EnergyStorage(); + } + return energyStorage; } @@ -243,6 +247,7 @@ public void process(final Runnable callback) { */ protected BatteryPack aggregatedBatteryInfo() { final BatteryPack result = new BatteryPack(); + result.packSOC = 0; result.maxPackChargeCurrent = Integer.MAX_VALUE; result.maxPackDischargeCurrent = Integer.MIN_VALUE; result.maxPackVoltageLimit = Integer.MAX_VALUE; diff --git a/core-api/src/main/java/com/airepublic/bmstoinverter/core/util/Util.java b/core-api/src/main/java/com/airepublic/bmstoinverter/core/util/BitUtil.java similarity index 100% rename from core-api/src/main/java/com/airepublic/bmstoinverter/core/util/Util.java rename to core-api/src/main/java/com/airepublic/bmstoinverter/core/util/BitUtil.java