Commit f4bec22a616bb1f43ac2e51eeedda9162d880c9c
1 parent
c3ee6785
Send to rule chain a timestamp when KV entries were updated
Showing
1 changed file
with
5 additions
and
2 deletions
... | ... | @@ -771,10 +771,13 @@ public abstract class BaseController { |
771 | 771 | } |
772 | 772 | } else if (actionType == ActionType.TIMESERIES_UPDATED) { |
773 | 773 | List<TsKvEntry> telemetry = extractParameter(List.class, 0, additionalInfo); |
774 | - if (telemetry != null) { | |
774 | + if (telemetry != null && !telemetry.isEmpty()) { | |
775 | + ObjectNode values = json.createObjectNode(); | |
775 | 776 | for (TsKvEntry tsKvEntry : telemetry) { |
776 | - addKvEntry(entityNode, tsKvEntry); | |
777 | + addKvEntry(values, tsKvEntry); | |
777 | 778 | } |
779 | + entityNode.put("ts", telemetry.get(0).getTs()); | |
780 | + entityNode.set("values", values); | |
778 | 781 | } |
779 | 782 | } |
780 | 783 | } | ... | ... |