From abf4a98837e43e542701c60b7ec6a088cd5236da Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 22 二月 2021 09:10:35 +0800 Subject: [PATCH] 20210222 --- HDL_ON/Common/ApiUtlis.cs | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index a01e24d..3387e6f 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -161,10 +161,11 @@ } if (FunctionList.List.GetDeviceFunctionList().Count > 0) { + for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) { var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; - if (localFunction.functionCategory == FunctionCategory.Music) + if (localFunction.Spk_Prefix == FunctionCategory.Music || string.IsNullOrEmpty(localFunction.Spk_Prefix)) { i++; continue; @@ -178,19 +179,23 @@ { 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);//鎿嶄綔瀹岀殑鏁版嵁娓呯悊鎺夛紝鍓╀笅鐨勫氨鏄柊澧炵殑鍔熻兘 } } + + } //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳� foreach (var newFunction in deviceList.list) @@ -301,6 +306,10 @@ waitPage.Hide(); waitPage.RemoveFromParent(); }); + //涓嶈�冭檻缃戝叧鎯呭喌锛岀洿鎺ヨ闃� + DAL.Mqtt.MqttClient.InitState(); + + FunctionList.List.Read3tyFunctionStatus(); } }); downloadDataThread.IsBackground = true; -- Gitblit v1.8.0