| | |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.Entity; |
| | |
| | | { |
| | | if (IsRemote)//如果是远程 |
| | | { |
| | | if(DB_ResidenceData.Instance.HomeGateway == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!DB_ResidenceData.Instance.HomeGateway.gatewayStatus)//远程情况下,网关未链接服务器不能修改主页网关状态 |
| | | { |
| | | new System.Threading.Thread(() => { |
| | |
| | | /// </summary> |
| | | public void SearchLoaclGateway() |
| | | { |
| | | //2021-01-15 : 住宅没有绑定网关的时候不用搜索,并且不能链接mqtt |
| | | if(DB_ResidenceData.Instance.HomeGateway == null) |
| | | { |
| | | return; |
| | | } |
| | | var ggg = DB_ResidenceData.Instance.GatewayType == 0 ? "一端口" : "A网关"; |
| | | var ggg1 = MainPage.InternetStatus == 1 ? "4G" : "wifi"; |
| | | MainPage.Log($"搜索网关列表,网关类型:{ggg};网络类型:{ggg1}"); |
| | |
| | | public void SwtichFunctions(bool open,List<Function> functions) |
| | | { |
| | | var count = 0; |
| | | var logString = open ? "打开" : "关闭"; |
| | | var logString = open ? "打开\r\n" : "关闭\r\n"; |
| | | List<ApiAlinkControlActionObj> actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, open ? "on" : "off"); |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | foreach (var temp in functions) |
| | | { |
| | | logString += temp.spk + ":" + temp.sid; |
| | | logString += temp.spk + ":" + temp.sid + "\r\n"; |
| | | var apiControlData = temp.GetApiControlData(d); |
| | | actionObjs.Add(apiControlData); |
| | | count++; |
| | |
| | | { |
| | | if (Ins.IsRemote) |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var result = pm.ExecuteScene(scene.userSceneId); |
| | | //云端做处理发送一端口场景 |
| | | //if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | //{ |
| | | // new Control_Udp().ControlBusScenes(scene); |
| | | //} |
| | | //else |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var result = pm.ExecuteScene(scene.userSceneId); |
| | | } |
| | | } |
| | | else |
| | | { |