-
Notifications
You must be signed in to change notification settings - Fork 48
feat: Adapting flex-config to SensorsToShowSchema #1904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 39 commits
00904f4
b3afe9e
af66726
3219aa3
1611134
fbb9791
e6babb8
a1fd936
db3a1fe
2f2639c
072d1b2
a6dcc6e
6fd81be
d257c94
6e650de
24cc4a2
328aba7
9d25020
a6596bc
8c01eae
39d03c4
cf0f180
41c9e8d
577459b
68b2ac9
f65b1b6
2bbb7d2
2d2eb60
cb5f009
5e2d55d
4d11124
f2d905f
8421d65
c1fd4bf
58af007
a29eda2
870fb69
d13c561
af3f3ca
e0683d4
76cf50b
68c952f
ec9f718
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1824,19 +1824,23 @@ def create_asset_with_one_sensor( | |
| db.session.flush() | ||
| battery = discharging_sensor.generic_asset | ||
| battery.sensors_to_show = [ | ||
| {"title": "Prices", "sensor": day_ahead_sensor.id}, | ||
| {"title": "Prices", "plots": [{"sensor": day_ahead_sensor.id}]}, | ||
| { | ||
| "title": "Power flows", | ||
| "sensors": [production_sensor.id, discharging_sensor.id], | ||
| "plots": [ | ||
| {"sensors": [production_sensor.id, discharging_sensor.id]}, | ||
| ], | ||
| }, | ||
| ] | ||
|
|
||
| # the site gets a similar dashboard (TODO: after #1801, add also capacity constraint) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This TODO is for you :) Add the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you referring to the graph page as "dashboard" here, or something else?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sorry |
||
| building_asset.sensors_to_show = [ | ||
| {"title": "Prices", "sensor": day_ahead_sensor.id}, | ||
| {"title": "Prices", "plots": [{"sensor": day_ahead_sensor.id}]}, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, we should test the new way here, please refer to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By that, you mean I should try creating a graph referencing the flex context?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, right now it references the day_ahead sensor directly, and I'd like to change that to reference the flex-config field instead. No new graph needed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh so I should reference it through an asset rather than directly adding the sensor, is what you mean. |
||
| { | ||
| "title": "Power flows", | ||
| "sensors": [production_sensor.id, discharging_sensor.id], | ||
| "plots": [ | ||
| {"sensors": [production_sensor.id, discharging_sensor.id]}, | ||
| ], | ||
| }, | ||
| ] | ||
|
|
||
|
|
@@ -1876,10 +1880,10 @@ def create_asset_with_one_sensor( | |
|
|
||
| process = shiftable_power.generic_asset | ||
| process.sensors_to_show = [ | ||
| {"title": "Prices", "sensor": day_ahead_sensor.id}, | ||
| {"title": "Inflexible", "sensor": inflexible_power.id}, | ||
| {"title": "Breakable", "sensor": breakable_power.id}, | ||
| {"title": "Shiftable", "sensor": shiftable_power.id}, | ||
| {"title": "Prices", "plots": [{"sensor": day_ahead_sensor.id}]}, | ||
| {"title": "Inflexible", "plots": [{"sensor": inflexible_power.id}]}, | ||
| {"title": "Breakable", "plots": [{"sensor": breakable_power.id}]}, | ||
| {"title": "Shiftable", "plots": [{"sensor": shiftable_power.id}]}, | ||
| ] | ||
|
|
||
| db.session.commit() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.