Skip to content

Commit

Permalink
Added integer definition for tgt_soc
Browse files Browse the repository at this point in the history
Defensive coding to avoid tgt_soc being set as non-integer externally and failing comparison checks
  • Loading branch information
salewis38 authored Sep 25, 2023
1 parent 3c9e888 commit b45e814
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion palm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self):
self.consumption: int = 0
self.soc: int = 0
self.base_load = stgs.GE.base_load
self.tgt_soc = 100
self.tgt_soc: int = 100
self.cmd_list = stgs.GE_Command_list['data']
self.plot = [""] * 5

Expand Down Expand Up @@ -393,13 +393,15 @@ def compute_tgt_soc(self, gen_fcast, weight: int, commit: bool) -> str:
if weight > 50:
wgt_50 = 90 - weight
else:

wgt_50 = weight - 10
wgt_90 = max(0, weight - 50)

logger.info("")
logger.info("{:<20} {:>10} {:>10} {:>10} {:>10} {:>10} {:>10}".format("SoC Calc;",
"Day", "Hour", "Charge", "Cons", "Gen", "SoC"))

tgt_soc: int = 100
# Definitions for export of SoC forecast in chart form
plot_x = ["Time"]
plot_y1 = ["Calculated SoC"]
Expand Down

0 comments on commit b45e814

Please sign in to comment.