From 47cb3bae8b329c40960c046158e6f96de8d1724c Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 2 Sep 2023 21:42:28 +0200 Subject: [PATCH] Smaller fixes - fixes https://github.com/Louisvdw/dbus-serialbattery/issues/792#issuecomment-1703147692 --- etc/dbus-serialbattery/battery.py | 12 ++++++------ etc/dbus-serialbattery/config.default.ini | 4 ++-- etc/dbus-serialbattery/dbushelper.py | 2 +- etc/dbus-serialbattery/utils.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/etc/dbus-serialbattery/battery.py b/etc/dbus-serialbattery/battery.py index 6bc6152d..e3e73401 100644 --- a/etc/dbus-serialbattery/battery.py +++ b/etc/dbus-serialbattery/battery.py @@ -576,7 +576,7 @@ def manage_charge_current(self) -> None: if self.max_battery_charge_current != tmp: if tmp in charge_limits: # do not add string, if global limitation is applied - if charge_limits["tmp"] != "Max Battery Charge Current": + if charge_limits[tmp] != "Max Battery Charge Current": charge_limits.update( {tmp: charge_limits[tmp] + ", Cell Voltage"} ) @@ -590,7 +590,7 @@ def manage_charge_current(self) -> None: if self.max_battery_charge_current != tmp: if tmp in charge_limits: # do not add string, if global limitation is applied - if charge_limits["tmp"] != "Max Battery Charge Current": + if charge_limits[tmp] != "Max Battery Charge Current": charge_limits.update({tmp: charge_limits[tmp] + ", Temp"}) else: pass @@ -602,7 +602,7 @@ def manage_charge_current(self) -> None: if self.max_battery_charge_current != tmp: if tmp in charge_limits: # do not add string, if global limitation is applied - if charge_limits["tmp"] != "Max Battery Charge Current": + if charge_limits[tmp] != "Max Battery Charge Current": charge_limits.update({tmp: charge_limits[tmp] + ", SoC"}) else: pass @@ -659,7 +659,7 @@ def manage_charge_current(self) -> None: if self.max_battery_discharge_current != tmp: if tmp in discharge_limits: # do not add string, if global limitation is applied - if discharge_limits["tmp"] != "Max Battery Discharge Current": + if discharge_limits[tmp] != "Max Battery Discharge Current": discharge_limits.update( {tmp: discharge_limits[tmp] + ", Cell Voltage"} ) @@ -673,7 +673,7 @@ def manage_charge_current(self) -> None: if self.max_battery_discharge_current != tmp: if tmp in discharge_limits: # do not add string, if global limitation is applied - if discharge_limits["tmp"] != "Max Battery Discharge Current": + if discharge_limits[tmp] != "Max Battery Discharge Current": discharge_limits.update({tmp: discharge_limits[tmp] + ", Temp"}) else: pass @@ -685,7 +685,7 @@ def manage_charge_current(self) -> None: if self.max_battery_discharge_current != tmp: if tmp in discharge_limits: # do not add string, if global limitation is applied - if discharge_limits["tmp"] != "Max Battery Discharge Current": + if discharge_limits[tmp] != "Max Battery Discharge Current": discharge_limits.update({tmp: discharge_limits[tmp] + ", SoC"}) else: pass diff --git a/etc/dbus-serialbattery/config.default.ini b/etc/dbus-serialbattery/config.default.ini index 491dcb8e..8bfd9ff8 100644 --- a/etc/dbus-serialbattery/config.default.ini +++ b/etc/dbus-serialbattery/config.default.ini @@ -75,11 +75,11 @@ LINEAR_RECALCULATION_ON_PERC_CHANGE = 5 ; it switches back to max voltage. ; Example: The battery reached max voltage of 55.2V and hold it for 900 seconds, the the CVL is switched to ; float voltage of 53.6V to don't stress the batteries. Allow max voltage of 55.2V again, if SoC is -; once below 90% +; once below 80% ; OR ; The battery reached max voltage of 55.2V and the max cell difference is 0.010V, then switch to float ; voltage of 53.6V after 300 additional seconds to don't stress the batteries. Allow max voltage of -; 55.2V again if max cell difference is above 0.080V or SoC below 90%. +; 55.2V again if max cell difference is above 0.080V or SoC below 80%. ; Charge voltage control management enable (True/False). CVCM_ENABLE = True diff --git a/etc/dbus-serialbattery/dbushelper.py b/etc/dbus-serialbattery/dbushelper.py index 794c78e7..d8d2b77b 100644 --- a/etc/dbus-serialbattery/dbushelper.py +++ b/etc/dbus-serialbattery/dbushelper.py @@ -635,7 +635,7 @@ def publish_dbus(self): ) # Update TimeToGo item - if utils.TIME_TO_GO_ENABLE: + if utils.TIME_TO_GO_ENABLE and crntPrctPerSec is not None: # Update TimeToGo item, has to be a positive int since it's used from dbus-systemcalc-py time_to_go = self.battery.get_timeToSoc( # switch value depending on charging/discharging diff --git a/etc/dbus-serialbattery/utils.py b/etc/dbus-serialbattery/utils.py index 34caa057..3e6cfa58 100644 --- a/etc/dbus-serialbattery/utils.py +++ b/etc/dbus-serialbattery/utils.py @@ -38,7 +38,7 @@ def _get_list_from_config( # Constants - Need to dynamically get them in future -DRIVER_VERSION = "1.0.20230827dev" +DRIVER_VERSION = "1.0.20230902dev" zero_char = chr(48) degree_sign = "\N{DEGREE SIGN}"