Skip to content

Commit

Permalink
add day-ahead prices to default battery dashboard of toy account (#576)
Browse files Browse the repository at this point in the history
* add day-ahead prices to default battery dashboard of toy account

Signed-off-by: Nicolas Höning <[email protected]>

* refactor so possible merge conflicts are minimal

Signed-off-by: Nicolas Höning <[email protected]>

Signed-off-by: Nicolas Höning <[email protected]>
  • Loading branch information
nhoening authored Jan 4, 2023
1 parent 2c25bc8 commit 23f67a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion flexmeasures/cli/data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,9 @@ def add_toy_account(kind: str, name: str):
db.session.add(asset)
if asset_type == "battery":
asset.attributes = dict(
capacity_in_mw=0.5, min_soc_in_mwh=0.05, max_soc_in_mwh=0.45
capacity_in_mw=0.5,
min_soc_in_mwh=0.05,
max_soc_in_mwh=0.45,
)
# add charging sensor to battery
charging_sensor = Sensor(
Expand Down Expand Up @@ -1107,6 +1109,13 @@ def add_toy_account(kind: str, name: str):
)
db.session.add(day_ahead_sensor)

# add day-ahead sensor to battery page
db.session.flush()
battery = charging_sensor.generic_asset
battery.attributes["sensors_to_show"] = [
day_ahead_sensor.id,
charging_sensor.id,
]
db.session.commit()

click.echo(
Expand Down

0 comments on commit 23f67a2

Please sign in to comment.