Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
398 Support optional "source" in /sensors/data [GET] (#543)
Allow to filter requests for sensor data by data source. Users can find out relevant source ids from chart tooltips. Also fixes the return message of /sensors/data [GET] and the replacement of NaN values with null values in the returned JSON. * Make SourceIdField importable and usable for API validation Signed-off-by: F.N. Claessen <felix@seita.nl> * Allow filtering sensor data by source in API Signed-off-by: F.N. Claessen <felix@seita.nl> * Show source id in chart tooltip so users have somewhere to find them Signed-off-by: F.N. Claessen <felix@seita.nl> * Add test for /sensors/data [GET] Signed-off-by: F.N. Claessen <felix@seita.nl> * Test source field, and refactor test setup Signed-off-by: F.N. Claessen <felix@seita.nl> * Test resolution field Signed-off-by: F.N. Claessen <felix@seita.nl> * Test averaging event values when using resolution field Signed-off-by: F.N. Claessen <felix@seita.nl> * Add type annotations, flake8 Signed-off-by: F.N. Claessen <felix@seita.nl> * Remove double line breaks Signed-off-by: F.N. Claessen <felix@seita.nl> * API changelog entry for introduction of 'source' field Signed-off-by: F.N. Claessen <felix@seita.nl> * Missing punctuation Signed-off-by: F.N. Claessen <felix@seita.nl> * API changelog entry for return message fix Signed-off-by: F.N. Claessen <felix@seita.nl> * Add missing API documentation for optional fields Signed-off-by: F.N. Claessen <felix@seita.nl> * Update API documentation section on sources Signed-off-by: F.N. Claessen <felix@seita.nl> * Move test to module using fresh db for each test to avoid session flush Signed-off-by: F.N. Claessen <felix@seita.nl> * Faster conversion of NaN values (we were just missing the dtype conversion) Signed-off-by: F.N. Claessen <felix@seita.nl> * Update inline comment Signed-off-by: F.N. Claessen <felix@seita.nl> * typo Signed-off-by: F.N. Claessen <felix@seita.nl> * Redundant flush Signed-off-by: F.N. Claessen <felix@seita.nl> * Ownership is an asset property, not a sensor property Signed-off-by: F.N. Claessen <felix@seita.nl> * Move flush to where it's needed (not the conftest) Signed-off-by: F.N. Claessen <felix@seita.nl> * No need to set up gas measurements as part of another fixture Signed-off-by: F.N. Claessen <felix@seita.nl> * Changelog entries Signed-off-by: F.N. Claessen <felix@seita.nl> Signed-off-by: F.N. Claessen <felix@seita.nl>
- Loading branch information
Showing
11 changed files
with
144 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .assets import LatitudeField, LongitudeField # noqa F401 | ||
from .generic_assets import GenericAssetIdField as AssetIdField # noqa F401 | ||
from .sensors import SensorIdField # noqa F401 | ||
from .sources import DataSourceIdField as SourceIdField # noqa F401 | ||
from .times import AwareDateTimeField, DurationField # noqa F401 |
Oops, something went wrong.