Skip to content

Commit

Permalink
[influxdb] v2: Fix history queries if items are not tagged (openhab#1…
Browse files Browse the repository at this point in the history
…0888)

Was missing in openhab#10680

Fixes openhab#10887

Signed-off-by: Stefan Triller <github@stefantriller.de>
Signed-off-by: Luca Calcaterra <calcaterra.luca@gmail.com>
  • Loading branch information
t2000 authored and lucacalcaterra committed Jul 26, 2021
1 parent f2e0649 commit 4d8ce32
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 4d8ce32

Please sign in to comment.