|
|
|
@ -17,6 +17,7 @@ package org.thingsboard.server.extensions.core.plugin.telemetry; |
|
|
|
|
|
|
|
import lombok.Setter; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.thingsboard.server.common.data.DataConstants; |
|
|
|
import org.thingsboard.server.common.data.id.DeviceId; |
|
|
|
import org.thingsboard.server.common.data.id.EntityId; |
|
|
|
@ -211,7 +212,7 @@ public class SubscriptionManager { |
|
|
|
public void onAttributesUpdateFromServer(PluginContext ctx, EntityId entityId, String scope, List<AttributeKvEntry> attributes) { |
|
|
|
Optional<ServerAddress> serverAddress = ctx.resolve(entityId); |
|
|
|
if (!serverAddress.isPresent()) { |
|
|
|
onLocalSubscriptionUpdate(ctx, entityId, s -> SubscriptionType.ATTRIBUTES == s.getType() && scope.equals(s.getScope()), s -> { |
|
|
|
onLocalSubscriptionUpdate(ctx, entityId, s -> SubscriptionType.ATTRIBUTES == s.getType() && (StringUtils.isEmpty(s.getScope()) || scope.equals(s.getScope())), s -> { |
|
|
|
List<TsKvEntry> subscriptionUpdate = new ArrayList<TsKvEntry>(); |
|
|
|
for (AttributeKvEntry kv : attributes) { |
|
|
|
if (s.isAllKeys() || s.getKeyStates().containsKey(kv.getKey())) { |
|
|
|
|