|
@@ -135,13 +135,8 @@ func (t *TempAlarmNode) newAlarmMessage(message *protocol.Message) error {
|
|
|
|
|
|
func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
deviceId := message.MetaData["device_id"].(string)
|
|
|
- fmt.Printf("message------------------:%s\r\n", gjson.New(message.MetaData).MustToJsonString())
|
|
|
-
|
|
|
- fmt.Printf("productKey------------------:%s\r\n", message.MetaData["product_key"])
|
|
|
- fmt.Printf("config:--------------------%s\r\n", gjson.New(t.config).MustToJsonString())
|
|
|
// 判断设备类型
|
|
|
if message.MetaData["product_key"].(string) != t.config.ProductKey {
|
|
|
-
|
|
|
return false
|
|
|
}
|
|
|
|
|
@@ -208,7 +203,7 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
if err != nil {
|
|
|
server.Log.Errorf("device offline error. deviceid: %v, error: %v", reply.AlarmParams.DeviceCode, err)
|
|
|
}
|
|
|
-
|
|
|
+ fmt.Printf("reply------------------:%s\r\n", gjson.New(reply).MustToJsonString())
|
|
|
if reply.AlarmParams.FirstReportTime == 0 {
|
|
|
setArgs := rpcs.ArgsAlarmInfo{
|
|
|
DeviceCode: deviceId,
|
|
@@ -234,7 +229,6 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
|
|
|
if err != nil {
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
return true
|
|
|
}
|
|
|
}
|