|
@@ -137,10 +137,8 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
// 判断设备类型
|
|
|
|
|
|
productKey := message.MetaData["product_key"].(string)
|
|
|
- fmt.Printf("产品key:%s---------------\n", productKey)
|
|
|
|
|
|
if productKey != t.config.ProductKey && productKey != mainCode {
|
|
|
- fmt.Printf("产品key匹配不正确返回false----------------\n")
|
|
|
return false
|
|
|
}
|
|
|
|
|
@@ -151,13 +149,11 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
onlinereply := rpcs.ReplyGetDeviceOnlineStatus{}
|
|
|
err := server.RPCCallByName(nil, rpcs.DeviceManagerName, "DeviceManager.GetDeviceOnlineStatus", onlineargs, &onlinereply)
|
|
|
if err != nil || onlinereply.ClientIP == "" {
|
|
|
- fmt.Printf("设备不在线返回false----------------\n")
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
// 判断报警规则
|
|
|
if len(t.config.Rules) == 0 {
|
|
|
- fmt.Printf("未匹配到报警规则返回false----------------\n")
|
|
|
return false
|
|
|
}
|
|
|
|
|
@@ -170,7 +166,6 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
}
|
|
|
// 判断设备是否开机
|
|
|
if data["power"].(float64) == 0 {
|
|
|
- fmt.Printf("未开机返回false----------------\n")
|
|
|
_ = deleteAlarm(deviceId)
|
|
|
return false
|
|
|
}
|