mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[feat]网关子设备,直接上传,自动创建设备模型,无需手动创建
This commit is contained in:
@@ -3,7 +3,6 @@ package nodes
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/sirupsen/logrus"
|
||||
"log"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
@@ -36,7 +35,6 @@ func (n *clearAlarmNode) Handle(msg *message.Message) error {
|
||||
|
||||
alarm := services.DeviceAlarmModelDao.FindOneByType(msg.Metadata.GetValue("deviceId").(string), n.AlarmType, "0")
|
||||
if alarm.DeviceId != "" {
|
||||
log.Println("清除告警")
|
||||
alarm.State = global.CLEARED
|
||||
marshal, _ := json.Marshal(msg.Msg)
|
||||
alarm.Details = string(marshal)
|
||||
|
||||
@@ -3,7 +3,6 @@ package nodes
|
||||
import (
|
||||
"errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"log"
|
||||
"pandax/pkg/rule_engine/manifest"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
)
|
||||
@@ -71,7 +70,6 @@ func GetNodes(m *manifest.Manifest) (map[string]Node, error) {
|
||||
metadata := NewMetadataWithValues(n.Properties)
|
||||
node, err := NewNode(n.Type, n.Id, metadata)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
logrus.Errorf("new node '%s' failure", n.Id)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user