| | |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | foreach (var temp in functions) |
| | | foreach (var function in functions) |
| | | { |
| | | Dictionary<string, string> d1 = new Dictionary<string, string>(); |
| | | d1.Add(FunctionAttributeKey.OnOff, open ? "on" : "off"); |
| | | SendWriteCommand(temp, d1); |
| | | if (function.spk == SPK.PanelSocket) |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) |
| | | { |
| | | d1.Add("on_off_usb", function.trait_on_off.curValue.ToString()); |
| | | } |
| | | } |
| | | SendWriteCommand(function, d1); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | }) |
| | |
| | | var revString = Encoding.UTF8.GetString(receiveBytes); |
| | | receiveObj.BodyDataString = revString; |
| | | MainPage.Log($"局域网信息: 解密后:" + receiveObj.BodyDataString); |
| | | //if(receiveObj.Topic.EndsWith("/thing/property/up")) |
| | | //if (receiveObj.Topic.EndsWith("/thing/property/up")) |
| | | //{ |
| | | // MsgInfoList.Add(revString + "\r\n"); |
| | | //} |
| | |
| | | var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid); |
| | | if (localFunction == null) |
| | | { |
| | | Console.WriteLine("找不到音乐播放器添=======" + revString); |
| | | continue; |
| | | } |
| | | if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理 |
| | |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | |
| | | Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | |
| | | } |
| | | |
| | | //更新界面状态 |
| | |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | SocketPage.UpdataState(localFunction); |
| | | SocketPage_InstantaneousValue.UpdataView(localFunction); |
| | | break; |
| | | case SPK.ElectricTV: |
| | | break; |