Merge pull request #13013 from dashevchenko/lineChartFix

Adding threshold to time-series line chart affects data sources post-processing
This commit is contained in:
Viacheslav Klimov 2025-03-26 16:06:12 +02:00 committed by GitHub
commit b6bd1ad5db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -725,7 +725,12 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc
update = new EntityDataUpdate(ctx.getCmdId(), ctx.getData(), null, ctx.getMaxEntitiesPerDataSubscription()); update = new EntityDataUpdate(ctx.getCmdId(), ctx.getData(), null, ctx.getMaxEntitiesPerDataSubscription());
ctx.setInitialDataSent(true); ctx.setInitialDataSent(true);
} else { } else {
update = new EntityDataUpdate(ctx.getCmdId(), null, ctx.getData().getData(), ctx.getMaxEntitiesPerDataSubscription()); // if ctx has timeseries subscription, timeseries values are cleared after each update and is empty in ctx data,
// so to avoid sending timeseries update with empty map we set it to null
List<EntityData> preparedData = ctx.getData().getData().stream()
.map(entityData -> new EntityData(entityData.getEntityId(), entityData.getLatest(), null))
.toList();
update = new EntityDataUpdate(ctx.getCmdId(), null, preparedData, ctx.getMaxEntitiesPerDataSubscription());
} }
ctx.sendWsMsg(update); ctx.sendWsMsg(update);
} finally { } finally {