【fix】修复设置属性,指令下发,单双向

This commit is contained in:
PandaX
2023-10-10 15:19:35 +08:00
parent eb83923849
commit 4323383bb8
9 changed files with 251 additions and 63 deletions

View File

@@ -148,6 +148,7 @@ func (p *DeviceApi) DownAttribute(rc *restfulx.ReqCtx) {
key := restfulx.QueryParam(rc, "key")
value := restfulx.QueryParam(rc, "value")
one := p.DeviceApp.FindOne(id)
biz.IsTrue(one.LinkStatus == global.ONLINE, "设备不在线无法设置属性")
if one.Product.ProtocolName == global.TCPProtocol {
err := tcpclient.Send(id, value)
biz.ErrIsNil(err, "属性下发失败")