diff --git a/apps/device/api/device.go b/apps/device/api/device.go index ebe18e4..2ac17d5 100644 --- a/apps/device/api/device.go +++ b/apps/device/api/device.go @@ -112,7 +112,7 @@ func (p *DeviceApi) GetDeviceStatus(rc *restfulx.ReqCtx) { Type: tel.Type, Define: tel.Define, } - if v, ok := rs[strings.ToLower(tel.Key)]; ok { + if v, ok := rs[tel.Key]; ok { sdv.Value = v.Value sdv.Time = v.UpdatedAt } else { diff --git a/iothub/hook_message_work/hook_message_work.go b/iothub/hook_message_work/hook_message_work.go index cc77015..a1cea09 100644 --- a/iothub/hook_message_work/hook_message_work.go +++ b/iothub/hook_message_work/hook_message_work.go @@ -74,7 +74,6 @@ func (s *HookService) handleOne(msg *netbase.DeviceEventInfo) { global.Log.Error("规则链执行失败", errs) } // 保存设备影子 - log.Println(ruleMessage.Msg, msg.Type, msg.DeviceAuth) if msg.Type != message.RpcRequestMes { SetDeviceShadow(msg.DeviceAuth, ruleMessage.Msg, msg.Type) } @@ -172,11 +171,12 @@ func SetDeviceShadow(etoken *tool.DeviceAuth, msgVals map[string]interface{}, ms } if message.AttributesMes == msgType { err := shadow.DeviceShadowInstance.SetDevicePoint(etoken.Name, global.TslAttributesType, tel.Key, msgVals[tel.Key]) - biz.ErrIsNil(err, "设置设备影子点失败") + biz.ErrIsNilAppendErr(err, "设置设备影子点失败") } if message.TelemetryMes == msgType { + log.Println(etoken.Name, global.TslTelemetryType, tel.Key, msgVals[tel.Key]) err := shadow.DeviceShadowInstance.SetDevicePoint(etoken.Name, global.TslTelemetryType, tel.Key, msgVals[tel.Key]) - biz.ErrIsNil(err, "设置设备影子点失败") + biz.ErrIsNilAppendErr(err, "设置设备影子点失败") } } }