Skip to content

Commit

Permalink
feat: unit filter features on get sensors API
Browse files Browse the repository at this point in the history
Signed-off-by: joshuaunity <[email protected]>
  • Loading branch information
joshuaunity committed Sep 25, 2024
1 parent ecd3966 commit 2a37dde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flexmeasures/api/v3_0/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def index(
sensor_query, search_terms=filter
)

if unit:
sensor_query = sensor_query.filter(Sensor.unit == unit)

sensors = (
db.session.scalars(sensor_query).all()
if page is None
Expand Down

0 comments on commit 2a37dde

Please sign in to comment.