Skip to content

Commit

Permalink
fix: skip conversion of soc_targets, soc_minima and soc_maxima if the…
Browse files Browse the repository at this point in the history
…y are defined from sensors.

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
  • Loading branch information
victorgarcia98 committed Apr 24, 2024
1 parent d407a21 commit 16d3d99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flexmeasures/data/schemas/scheduling/storage.py
Expand Up @@ -194,13 +194,13 @@ def post_load_sequence(self, data: dict, **kwargs) -> dict:
data["soc_min"] /= 1000.0
if data.get("soc_max") is not None:
data["soc_max"] /= 1000.0
if data.get("soc_targets"):
if not isinstance(data.get("soc_targets"), Sensor):
for target in data["soc_targets"]:
target["value"] /= 1000.0
if data.get("soc_minima"):
if not isinstance(data.get("soc_minima"), Sensor):
for minimum in data["soc_minima"]:
minimum["value"] /= 1000.0
if data.get("soc_maxima"):
if not isinstance(data.get("soc_maxima"), Sensor):
for maximum in data["soc_maxima"]:
maximum["value"] /= 1000.0
data["soc_unit"] = "MWh"
Expand Down

0 comments on commit 16d3d99

Please sign in to comment.