Skip to content

Commit

Permalink
fix error and change default value
Browse files Browse the repository at this point in the history
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept
  • Loading branch information
mr-manuel committed Jul 11, 2023
1 parent 35f4009 commit ca3a366
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def manage_charge_voltage_linear(self) -> None:
current_time = int(time())

# meassurment and variation tolerance in volts
measurementToleranceVariation = 0.025
measurementToleranceVariation = 0.5

try:
# calculate battery sum and check for cell overvoltage
Expand Down Expand Up @@ -463,12 +463,13 @@ def manage_charge_voltage_linear(self) -> None:
bulk_days_ago = round(
(current_time - self.bulk_last_reached) / 60 / 60 / 24, 2
)
bulk_in_days = round(utils.BULK_AFTER_DAYS - bulk_days_ago, 2)
self.charge_mode_debug += "\nbulk_last_reached: " + str(
"Never"
if self.bulk_last_reached == 0
else str(bulk_days_ago)
+ " days ago - next in "
+ str(utils.BULK_AFTER_DAYS - bulk_days_ago)
+ str(bulk_in_days)
+ "days"
)
# """
Expand Down
4 changes: 2 additions & 2 deletions etc/dbus-serialbattery/dbushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ def publish_dbus(self):
self._dbusservice["/Alarms/HighVoltage"] = (
self.battery.protection.voltage_high
if (
self.bulk_requested is False
and self.bulk_last_reached < int(time()) - (60 * 30)
self.battery.bulk_requested is False
and self.battery.bulk_last_reached < int(time()) - (60 * 30)
)
else 0
)
Expand Down
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _get_list_from_config(


# Constants - Need to dynamically get them in future
DRIVER_VERSION = "1.0.20230704dev"
DRIVER_VERSION = "1.0.20230711dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down

0 comments on commit ca3a366

Please sign in to comment.