|
|
@ -29,6 +29,7 @@ import org.thingsboard.server.common.data.alarm.Alarm; |
|
|
import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; |
|
|
import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; |
|
|
import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; |
|
|
import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; |
|
|
import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; |
|
|
import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; |
|
|
|
|
|
import org.thingsboard.server.common.data.exception.ApiUsageLimitsExceededException; |
|
|
import org.thingsboard.server.common.data.id.DeviceId; |
|
|
import org.thingsboard.server.common.data.id.DeviceId; |
|
|
import org.thingsboard.server.common.data.id.DeviceProfileId; |
|
|
import org.thingsboard.server.common.data.id.DeviceProfileId; |
|
|
import org.thingsboard.server.common.data.id.EntityId; |
|
|
import org.thingsboard.server.common.data.id.EntityId; |
|
|
@ -261,7 +262,12 @@ class DeviceState { |
|
|
for (DeviceProfileAlarm alarm : deviceProfile.getAlarmSettings()) { |
|
|
for (DeviceProfileAlarm alarm : deviceProfile.getAlarmSettings()) { |
|
|
AlarmState alarmState = alarmStates.computeIfAbsent(alarm.getId(), |
|
|
AlarmState alarmState = alarmStates.computeIfAbsent(alarm.getId(), |
|
|
a -> new AlarmState(this.deviceProfile, deviceId, alarm, getOrInitPersistedAlarmState(alarm), dynamicPredicateValueCtx)); |
|
|
a -> new AlarmState(this.deviceProfile, deviceId, alarm, getOrInitPersistedAlarmState(alarm), dynamicPredicateValueCtx)); |
|
|
stateChanged |= alarmState.process(ctx, msg, latestValues, update); |
|
|
try { |
|
|
|
|
|
stateChanged |= alarmState.process(ctx, msg, latestValues, update); |
|
|
|
|
|
} catch (ApiUsageLimitsExceededException e) { |
|
|
|
|
|
alarmStates.remove(alarm.getId()); |
|
|
|
|
|
throw e; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|