Skip to content

Commit

Permalink
Added a log entry to indicate when the state of charge calculation ex…
Browse files Browse the repository at this point in the history
…ceeds 100%.
  • Loading branch information
felixschndr committed Nov 23, 2024
1 parent 7f84971 commit a4d10b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def calculate_state_of_charge_from_energy_amount(self, energy_amount: EnergyAmou
"""
state_of_charge = int(energy_amount.watt_hours / self.battery_capacity.watt_hours * 100)
if state_of_charge > 100:
self.log.info(f"The calculated state of charge is {state_of_charge}, capping it at 100 %")
return 100
return state_of_charge

Expand Down

0 comments on commit a4d10b1

Please sign in to comment.