From b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 10 一月 2020 17:35:23 +0800
Subject: [PATCH] 2020.1.10

---
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs |   78 ++++++++++++++++++++++----------------
 1 files changed, 45 insertions(+), 33 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index cef4542..67e7c78 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -284,14 +284,6 @@
                                                     ac.currentSystemMode = attList.AttriButeData;
                                                     ac.LastDateTime = DateTime.Now;
                                                     break;
-                                                case 4099:
-                                                    var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0');
-                                                    var modeStr = value.Substring(value.Length - 5, 5);
-                                                    for (int j = 0; j < modeStr.Length; j++)
-                                                    {
-                                                        ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
-                                                    }
-                                                    break;
                                                 case 4097:
                                                     //杩囪檻缃戞竻娲楁爣蹇�:42
                                                     ac.CleanStatu = attList.AttriButeData == 42;
@@ -885,7 +877,7 @@
             typeIdDic.Clear();
             foreach (var device in devList)
             {
-                var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice });
+                var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
                 if (info.BeloneType == DeviceBeloneType.A骞叉帴鐐� || info.BeloneType == DeviceBeloneType.A涓户鍣�)
                 {
                     continue;
@@ -1093,7 +1085,7 @@
                                         }
                                     })
                                     { IsBackground = true }.Start();
-                                    
+
                                     var deviceRow = new CategoryFunctionRow(0, 35);
                                     deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                     deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
@@ -1780,18 +1772,14 @@
         /// <param name="sameTypeList"></param>
         /// <param name="devListScrolView"></param>
         /// <param name="deviceRow"></param>
-        private void ReFreshDeviceAction(DeviceUI deviceUI,Common.Room curRoom,List<DeviceUI> sameTypeList,VerticalScrolViewLayout devListScrolView,CategoryFunctionRow deviceRow)
+        private void ReFreshDeviceAction(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionRow deviceRow)
         {
-            if (curRoom.Id != Common.Room.CurrentRoom.Id)
+            if (Common.Room.CurrentRoom.IsLove)
             {
-                if(Common.Room.CurrentRoom.IsLove)
+                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false)
                 {
-                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                }
-                else
-                {
-                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                     devListScrolView.RemoveViewByTag(deviceUI);
                     sameTypeList.Remove(deviceUI);
                     if (sameTypeList.Count == 0)
@@ -1802,8 +1790,21 @@
             }
             else
             {
-                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                if (curRoom.Id != Common.Room.CurrentRoom.Id)
+                {
+                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
+                    devListScrolView.RemoveViewByTag(deviceUI);
+                    sameTypeList.Remove(deviceUI);
+                    if (sameTypeList.Count == 0)
+                    {
+                        RefreshFunction(Common.Room.CurrentRoom);
+                    }
+                }
+                else
+                {
+                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                }
             }
         }
 
@@ -1816,16 +1817,12 @@
         /// <param name="deviceRow"></param>
         private void ReFreshDeviceActionForWin(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionForWinRow deviceRow)
         {
-            if (curRoom.Id != Common.Room.CurrentRoom.Id)
+            if (Common.Room.CurrentRoom.IsLove)
             {
-                if (Common.Room.CurrentRoom.IsLove)
+                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false)
                 {
-                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                }
-                else
-                {
-                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                     devListScrolView.RemoveViewByTag(deviceUI);
                     sameTypeList.Remove(deviceUI);
                     if (sameTypeList.Count == 0)
@@ -1836,8 +1833,21 @@
             }
             else
             {
-                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                if (curRoom.Id != Common.Room.CurrentRoom.Id)
+                {
+                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
+                    devListScrolView.RemoveViewByTag(deviceUI);
+                    sameTypeList.Remove(deviceUI);
+                    if (sameTypeList.Count == 0)
+                    {
+                        RefreshFunction(Common.Room.CurrentRoom);
+                    }
+                }
+                else
+                {
+                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                }
             }
         }
 
@@ -2188,7 +2198,8 @@
                             Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
                             if (logiciocnBtn.Tag.ToString() == "3")
                             {
-                                Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;// Language.StringByID(MyInternationalizationString.automation1);
+                                Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
+                                Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
                                 var addLogicPage = new Logic.AddLogicPage();
                                 HomePage.Instance.AddChidren(addLogicPage);
                                 HomePage.Instance.PageIndex += 1;
@@ -2198,6 +2209,7 @@
                             {
 
                                 Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
+                                Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
                                 Logic.TemplatePage templatePage = new Logic.TemplatePage();
                                 Logic.TemplatePage.s = logiciocnBtn.Tag.ToString();
                                 HomePage.Instance.AddChidren(templatePage);
@@ -2852,4 +2864,4 @@
 
 
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.8.0