From 7b43f0f5c5dca88576efc0bb51bf95b523de90c9 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 10 七月 2020 11:33:06 +0800
Subject: [PATCH] 2020-07-10 1.修复窗帘定时器发送控制失败问题。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs
index 57d0c7f..ccd468f 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs
@@ -823,7 +823,7 @@
                                         Tag = deviceCommon.CommonLoopID,
                                     };
                                     DeviceRowView.AddChidren (tempSwitch);
-                                  
+
 
                                     if (deviceCommon.Type == DeviceType.FanModule) {
                                         #region 椋庢墖
@@ -874,7 +874,7 @@
                                             ProgressColor = SkinStyle.Current.SelectedColor,
                                             ThumbRadius = Application.GetRealWidth (3),
                                             Max = 8,
-                                            Progress =2,// (int)(deviceCommon.SendBytes[1]),
+                                            Progress = 2,// (int)(deviceCommon.SendBytes[1]),
 
                                         };
                                         DeviceRowView.AddChidren (fanLevel);
@@ -1083,12 +1083,14 @@
                                         #endregion
                                     } else if (deviceCommon.Type == DeviceType.CurtainModel || deviceCommon.Type == DeviceType.CurtainTrietex || deviceCommon.Type == DeviceType.CurtainRoller) {
                                         #region 绐楀笜
+                                        //2020-07-09 鍒锋柊鎺у埗鎿嶄綔鐮�
+                                        deviceCommon.Command = (int)Command.UpdataCurtainModelStutas;
                                         tempSwitch.RemoveFromParent ();
-                                       var tempSwitch1 = new Button () {
-                                           Width = Application.GetMinRealAverage (90),
-                                           Height = Application.GetMinRealAverage (53),
-                                           X = Application.GetRealWidth (640 - 90 - 20),
-                                           Radius = 5,
+                                        var tempSwitch1 = new Button () {
+                                            Width = Application.GetMinRealAverage (90),
+                                            Height = Application.GetMinRealAverage (53),
+                                            X = Application.GetRealWidth (640 - 90 - 20),
+                                            Radius = 5,
                                             BorderColor = SkinStyle.Current.Transparent,
                                             BorderWidth = 1,
                                             Gravity = Gravity.CenterVertical,
@@ -1118,10 +1120,13 @@
                                                 btnChoose.IsSelected = true;
                                             }
                                             deviceCommon.SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
-                                            if (timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath) == null) {
+                                            //2020-07-09
+                                            DeviceInfo mDeviceInfo = timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath);
+                                            if (mDeviceInfo == null) {
                                                 timerControlDeviceList.Add (deviceCommon);
                                             } else {
-                                                timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath).SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
+                                                mDeviceInfo.Command = (int)Command.UpdataCurtainModelStutas;
+                                                mDeviceInfo.SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
                                             }
                                         };
 
@@ -1150,10 +1155,19 @@
                                                 }
                                                 deviceCommon.SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
 
-                                                if (timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath) == null) {
+                                                //if (timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath) == null) {
+                                                //    timerControlDeviceList.Add (deviceCommon);
+                                                //} else {
+                                                //    timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath).SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
+                                                //}
+
+                                                //2020-07-09
+                                                DeviceInfo mDeviceInfo = timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath);
+                                                if (mDeviceInfo == null) {
                                                     timerControlDeviceList.Add (deviceCommon);
                                                 } else {
-                                                    timerControlDeviceList.Find ((obj) => obj.DevicePath == deviceCommon.SavePath).SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
+                                                    mDeviceInfo.Command = (int)Command.UpdataCurtainModelStutas;
+                                                    mDeviceInfo.SendBytes = new byte [] { deviceCommon.LoopID, (byte)CurrentBrightness };
                                                 }
                                             } else {
                                                 timerControlDeviceList.Remove (timerControlDeviceList.Find ((obj) => obj.DeviceType == (int)deviceCommon.Type &&

--
Gitblit v1.8.0