Skip to content

Commit

Permalink
fix some small errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Nov 28, 2023
1 parent 35fe921 commit c548092
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions etc/dbus-serialbattery/dbushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def __init__(self, battery):
)
self.path_battery = None
self.save_charge_details_last = {
"allow_max_voltage": None,
"max_voltage_start_time": None,
"soc_reset_last_reached": None,
"allow_max_voltage": self.battery.allow_max_voltage,
"max_voltage_start_time": self.battery.max_voltage_start_time,
"soc_reset_last_reached": self.battery.soc_reset_last_reached,
}

def setup_instance(self):
Expand Down Expand Up @@ -1014,14 +1014,16 @@ def custom_name_callback(self, path, value) -> str:

# save battery options to dbus
def saveBatteryOptions(self) -> bool:
result = True

if (
self.battery.allow_max_voltage
!= self.save_charge_details_last["allow_max_voltage"]
):
self.save_charge_details_last[
"allow_max_voltage"
] = self.battery.allow_max_voltage
result = self.setSetting(
result = result + self.setSetting(
get_bus(),
"com.victronenergy.settings",
self.path_battery,
Expand Down Expand Up @@ -1069,8 +1071,8 @@ def saveBatteryOptions(self) -> bool:
self.battery.soc_reset_last_reached,
)
logger.info(
f"Saved SocResetLastReached. Before {self.save_charge_details_last['soc_reset_last_reached']}, ",
+f"after {self.battery.soc_reset_last_reached}",
f"Saved SocResetLastReached. Before {self.save_charge_details_last['soc_reset_last_reached']}, "
+ f"after {self.battery.soc_reset_last_reached}",
)

return result
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _get_list_from_config(


# Constants
DRIVER_VERSION = "1.0.20231127dev"
DRIVER_VERSION = "1.0.20231128dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down

0 comments on commit c548092

Please sign in to comment.