wxr
2021-02-23 34d49c20c2c2543658e844847c5eaa87f4c954e9
HDL_ON/Common/ApiUtlis.cs
@@ -46,7 +46,7 @@
        public bool GatewayOnlineVerification()
        {
            bool result = DB_ResidenceData.Instance.HomeGateway.gatewayStatus;
            DriverLayer.Control.Ins.GatewayOnline_Cloud = result;
            if (!result)
            {
@@ -165,7 +165,7 @@
                            for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
                            {
                                var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
                                if (localFunction.Spk_Prefix == FunctionCategory.Music|| string.IsNullOrEmpty(localFunction.Spk_Prefix))
                                if (localFunction.Spk_Prefix == FunctionCategory.Music || string.IsNullOrEmpty(localFunction.Spk_Prefix))
                                {
                                    i++;
                                    continue;
@@ -179,16 +179,18 @@
                                {
                                    MainPage.Log($"deviceType:{localFunction.spk} local:{localFunction.modifyTime} server:{newFunction.modifyTime}");
                                    i++;
                                    if (localFunction.modifyTime != newFunction.modifyTime)
                                    {
                                        //可优化
                                        localFunction.name = newFunction.name;
                                        localFunction.collect = newFunction.collect;
                                        localFunction.modifyTime = newFunction.modifyTime;
                                        localFunction.roomIds = newFunction.roomIds;
                                        localFunction.bus = newFunction.bus;
                                        localFunction.SaveFunctionFile();
                                    }
                                    //if (localFunction.modifyTime != newFunction.modifyTime)
                                    //{
                                    //    //可优化
                                    //    localFunction.name = newFunction.name;
                                    //    localFunction.collect = newFunction.collect;
                                    //    localFunction.modifyTime = newFunction.modifyTime;
                                    //    localFunction.roomIds = newFunction.roomIds;
                                    //    localFunction.bus = newFunction.bus;
                                    //    localFunction.SaveFunctionFile();
                                    //}
                                    localFunction = newFunction;
                                    localFunction.SaveFunctionFile();
                                    deviceList.list.Remove(newFunction);//操作完的数据清理掉,剩下的就是新增的功能
                                }
                            }
@@ -304,6 +306,10 @@
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                    });
                    //不考虑网关情况,直接订阅
                    DAL.Mqtt.MqttClient.InitState();
                    FunctionList.List.Read3tyFunctionStatus();
                }
            });
            downloadDataThread.IsBackground = true;