From fe027abbadd23553135c4f751b7df89a076a5fa1 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 19 Feb 2024 14:47:21 +0100 Subject: [PATCH] Added error messages --- etc/dbus-serialbattery/battery.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etc/dbus-serialbattery/battery.py b/etc/dbus-serialbattery/battery.py index 0923f4d9..1dc13a12 100644 --- a/etc/dbus-serialbattery/battery.py +++ b/etc/dbus-serialbattery/battery.py @@ -854,6 +854,9 @@ def calcMaxChargeCurrentReferringToCellVoltage(self) -> float: False, ) except Exception: + logger.warning( + "Error while executing calcMaxChargeCurrentReferringToCellVoltage(). Using default value instead." + ) return self.max_battery_charge_current def calcMaxDischargeCurrentReferringToCellVoltage(self) -> float: @@ -871,6 +874,9 @@ def calcMaxDischargeCurrentReferringToCellVoltage(self) -> float: True, ) except Exception: + logger.warning( + "Error while executing calcMaxDischargeCurrentReferringToCellVoltage(). Using default value instead." + ) return self.max_battery_charge_current def calcMaxChargeCurrentReferringToTemperature(self) -> float: @@ -934,6 +940,9 @@ def calcMaxChargeCurrentReferringToSoc(self) -> float: True, ) except Exception: + logger.warning( + "Error while executing calcMaxChargeCurrentReferringToSoc(). Using default value instead." + ) return self.max_battery_charge_current def calcMaxDischargeCurrentReferringToSoc(self) -> float: @@ -951,6 +960,9 @@ def calcMaxDischargeCurrentReferringToSoc(self) -> float: True, ) except Exception: + logger.warning( + "Error while executing calcMaxDischargeCurrentReferringToSoc(). Using default value instead." + ) return self.max_battery_discharge_current def get_min_cell(self) -> int: