|
@@ -180,11 +180,11 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
} else {
|
|
|
for _, r := range results {
|
|
|
if r {
|
|
|
- break
|
|
|
+ return true
|
|
|
}
|
|
|
- _ = deleteAlarm(deviceId)
|
|
|
- return false
|
|
|
}
|
|
|
+ _ = deleteAlarm(deviceId)
|
|
|
+ return false
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -215,9 +215,9 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
}
|
|
|
|
|
|
duration := time.Now().Sub(time.Unix(reply.AlarmParams.FirstReportTime, 0))
|
|
|
- if duration.Seconds() > float64(t.config.Interval*60) {
|
|
|
+ if duration.Seconds() > float64(t.config.Duration*60) {
|
|
|
interval := time.Now().Sub(time.Unix(reply.AlarmParams.LastAlarmTime, 0))
|
|
|
- if interval.Seconds() >= float64(t.config.Duration*60) {
|
|
|
+ if interval.Seconds() >= float64(t.config.Interval*60) {
|
|
|
setArgs := rpcs.ArgsAlarmInfo{
|
|
|
DeviceCode: deviceId,
|
|
|
FirstReportTime: reply.AlarmParams.FirstReportTime,
|