mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[influxdb] v2: Fix history queries if items are not tagged (#10888)
Was missing in https://github.com/openhab/openhab-addons/pull/10680 Fixes #10887 Signed-off-by: Stefan Triller <github@stefantriller.de>
This commit is contained in:
parent
cd8aa5d604
commit
7c221d0fb7
@ -194,6 +194,9 @@ public class InfluxDB2RepositoryImpl implements InfluxDBRepository {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user