From d6b4e510f1430d19bc48da6894cf707bbe3c226d Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 29 十月 2019 14:25:15 +0800
Subject: [PATCH] 2019.10.29-2

---
 ZigbeeApp/Shared/Common/Device.cs |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs
index 77f300a..8f0dc65 100755
--- a/ZigbeeApp/Shared/Common/Device.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -85,7 +85,7 @@
         /// </summary>
         private Dictionary<string, HashSet<int>> dicDeviceEpoint = new Dictionary<string, HashSet<int>>();
         /// <summary>
-        /// 璁惧Mac椤哄簭(閲岄潰鏄疢ac鍦板潃)
+        /// 璁惧Mac椤哄簭
         /// </summary>
         private Dictionary<string, List<string>> dicDeviceSort = null;
         /// <summary>
@@ -1563,14 +1563,10 @@
         /// <returns></returns>
         public List<CommonDevice> SortDevice(List<CommonDevice> listDevice)
         {
-            var dic = new Dictionary<string, List<CommonDevice>>();
+            var dic = new Dictionary<string, CommonDevice>();
             for (int i = 0; i < listDevice.Count; i++)
             {
-                if (dic.ContainsKey(listDevice[i].DeviceAddr) == false)
-                {
-                    dic[listDevice[i].DeviceAddr] = new List<CommonDevice>();
-                }
-                dic[listDevice[i].DeviceAddr].Add(listDevice[i]);
+                dic[(this.GetDeviceMainKeys(listDevice[i]))] = listDevice[i];
             }
             var list = new List<CommonDevice>();
             foreach (var listSort in this.dicDeviceSort.Values)
@@ -1579,15 +1575,7 @@
                 {
                     if (dic.ContainsKey(listSort[i]) == true)
                     {
-                        dic[listSort[i]].Sort((obj1, obj2) =>
-                        {
-                            if (obj1.DeviceEpoint > obj2.DeviceEpoint)
-                            {
-                                return 1;
-                            }
-                            return -1;
-                        });
-                        list.AddRange(dic[listSort[i]]);
+                        list.Add(dic[listSort[i]]);
                     }
                 }
             }

--
Gitblit v1.8.0