修复设备端物模型解除绑定时设置属性失败的问题
This commit is contained in:
parent
f951a0eedc
commit
f492dd3092
@ -1090,8 +1090,20 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
}
|
||||
else if (input.Commands.ContainsKey(ThingModelFixedTypeConst.SpecialCommand))
|
||||
{
|
||||
//非绑定物模型情况下,SpecialCommand还原默认值,设备也会恢复默认采集方式
|
||||
input.Commands[ThingModelFixedTypeConst.SpecialCommand] = CommonConst.SpecialCommandDefaultValue;
|
||||
//设备端物模型解除绑定情况下,SpecialCommand 还原默认值,设备也会恢复默认采集方式
|
||||
//给SpecialCommand第一个参数设置默认值
|
||||
|
||||
var propertyInfo = await oneNETProductService.GetProductThingModelSpecialCommandDataTypeListAsync(new IdInput<string>() { Id = deviceInfo.IoTPlatformProductId });
|
||||
|
||||
if (propertyInfo == null)
|
||||
{
|
||||
throw new UserFriendlyException($"{nameof(DeviceCommandInfoToOneNET)} OneNET设备属性设置失败,产品Id{deviceInfo.IoTPlatformProductId}未找到对应的属性信息。");
|
||||
}
|
||||
string paName = propertyInfo.FirstOrDefault()?.Identifier;
|
||||
|
||||
input.Commands[ThingModelFixedTypeConst.SpecialCommand] = new Dictionary<string, object>() {
|
||||
{ paName, CommonConst.SpecialCommandDefaultValue }
|
||||
};
|
||||
logger.LogWarning($"{nameof(DeviceCommandInfoToOneNET)} OneNET平台设备{deviceInfo.DeviceAddress}特殊抄读指令还原为{CommonConst.SpecialCommandDefaultValue}");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user