flexmeasures.ui.views.sensors
Functions
- flexmeasures.ui.views.sensors.describe_fields_left_without_sensor(sensor: Sensor) tuple[str, Markup]
What the sensor page tells the user who deletes this sensor about the flex-config fields it would leave without a sensor.
Before deleting, the confirmation names them, as plain text. After deleting, a toast links to the editor for each of them, which the page shows once it has moved on to the sensor’s asset. A sensor can be referenced from assets the user cannot read, such as when it is public, so those are only counted, not named. A shared sensor, such as a price, can be referenced by many assets, so only the first few are named.
- Returns:
The note for the confirmation, and the toast, each empty if deleting the sensor leaves no field without one.
Classes
- class flexmeasures.ui.views.sensors.SensorUI
This view creates several new UI endpoints for viewing sensors.
todo: consider extending this view for crud purposes
- deletion_notes(id: int)
GET from /sensors/<id>/deletion-notes
What to tell the user about deleting this sensor, fetched once they click to delete it, as finding the flex-config fields it would leave without a sensor means searching every asset. This is for the sensor page only, so its response may change, unlike that of the API. It answers whoever the sensor page shows the delete button to, which is whoever the API lets delete the sensor.
- get(id: int, **kwargs)
GET from /sensors/<id> The following query parameters are supported (should be used only together):
start_time: minimum time of the events to be shown
end_time: maximum time of the events to be shown
In addition, the source query parameter can be used to pre-select a data source in the statistics panel (e.g. when linking here from an automation).