Skip to content

Commit

Permalink
[influxdb] v2: Fix history queries if items are not tagged (#10888)
Browse files Browse the repository at this point in the history
Was missing in openhab/openhab-addons#10680

Fixes #10887

Signed-off-by: Stefan Triller <github@stefantriller.de>
  • Loading branch information
t2000 authored Jun 21, 2021
1 parent 9aedfdb commit 03f931e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ private List<InfluxRow> convertClientResutToRepository(List<FluxTable> clientRes
private Stream<InfluxRow> mapRawResultToHistoric(FluxTable rawRow) {
return rawRow.getRecords().stream().map(r -> {
String itemName = (String) r.getValueByKey(InfluxDBConstants.TAG_ITEM_NAME);
if (itemName == null) { // use measurement name if item is not tagged
itemName = r.getMeasurement();
}
Object value = r.getValueByKey(COLUMN_VALUE_NAME_V2);
Instant time = (Instant) r.getValueByKey(COLUMN_TIME_NAME_V2);
return new InfluxRow(time, itemName, value);
Expand Down

0 comments on commit 03f931e

Please sign in to comment.