wei
2020-12-19 c5a873df96e4a797426e4dd5eafe5b43f7aea564
HDL_ON/DAL/DriverLayer/Control.cs
old mode 100755 new mode 100644
@@ -181,6 +181,9 @@
        /// </summary>
        public void SearchLoaclGateway()
        {
            MainPage.Log($"搜索本地网关列表,网关类型:{DB_ResidenceData.Instance.GatewayType}");
            if (MainPage.InternetStatus == 0)
                return;
            OpenUdp(DB_ResidenceData.Instance.GatewayType == 0 ? 6000 : 8585);
            new System.Threading.Thread(() =>
            {
@@ -198,13 +201,13 @@
                    }
                    System.Threading.Thread.Sleep(500);
                }
                if (!GatewayOnline)//网关不在线的时候才可尝试远程连接
                {
                    Ins.IsRemote = true;
                    DAL.Mqtt.MqttClient.InitState();
                }
            })
            { IsBackground = true }.Start();
            if (!GatewayOnline)//网关不在线的时候才可尝试远程连接
            {
                Ins.IsRemote = true;
                DAL.Mqtt.MqttClient.InitState();
            }
        }
        /// <summary>
@@ -565,7 +568,23 @@
                                    }
                                    break;
                                case SPK.LightRGBW:
                                case SPK.LightCCT:
                                    break;
                                case SPK.LightCCT:
                                    var lightCCT = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid);
                                    if (lightCCT != null)
                                    {
                                        localObj = lightCCT;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = lightCCT.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        lightCCT.lastState = Language.StringByID(StringId.Brightness) + " : " + lightCCT.brightness + "%";
                                        DimmerPage.UpdataStates(lightCCT);
                                    }
                                    break;
                                case SPK.CurtainSwitch:
                                    var curtain = FunctionList.List.curtains.Find((obj) => obj.sid == updateTemp.sid);