Fix device profile update handling by rule node - preserve old key values to correctly update entity keys snapshot

This commit is contained in:
Igor Kulikov 2021-09-01 16:28:27 +03:00
parent 9c9aee04c7
commit 8838a48bd1

View File

@ -100,7 +100,7 @@ class DeviceState {
} }
public void updateProfile(TbContext ctx, DeviceProfile deviceProfile) throws ExecutionException, InterruptedException { public void updateProfile(TbContext ctx, DeviceProfile deviceProfile) throws ExecutionException, InterruptedException {
Set<AlarmConditionFilterKey> oldKeys = this.deviceProfile.getEntityKeys(); Set<AlarmConditionFilterKey> oldKeys = Set.copyOf(this.deviceProfile.getEntityKeys());
this.deviceProfile.updateDeviceProfile(deviceProfile); this.deviceProfile.updateDeviceProfile(deviceProfile);
if (latestValues != null) { if (latestValues != null) {
Set<AlarmConditionFilterKey> keysToFetch = new HashSet<>(this.deviceProfile.getEntityKeys()); Set<AlarmConditionFilterKey> keysToFetch = new HashSet<>(this.deviceProfile.getEntityKeys());