From 2450c12c825ad4d78d1572da2fa421706db2df2f Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 18 六月 2020 16:01:14 +0800
Subject: [PATCH] 新代码

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
index cdb3057..6a1ef7c 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
@@ -215,9 +215,6 @@
         /// <param name="isOpen">鎵撳紑鐘舵��</param>
         private void RefreshSwitchStatu(bool isOpen)
         {
-            //鐘舵�佷竴鑷�(绗簩绱㈠紩鐨勬帶浠跺鏋滄槸閫夋嫨鐘舵��,鍒欏繀瀹氫负寮�鐘舵��)
-            if (listControl[1].IsSelected == isOpen) { return; }
-
             //鍙樻洿鐘舵��
             if (this.device.DfunctionType == DeviceFunctionType.A寮�鍏�)
             {
@@ -232,6 +229,8 @@
                 listControl[0].IsSelected = isOpen;
                 listControl[1].IsSelected = isOpen;
             }
+            //璁剧疆鐘舵�佹枃瀛�
+            this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
         }
 
         #endregion
@@ -252,8 +251,6 @@
                 {
                     //鍙樻洿鍗$墖鐘舵��
                     this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
-                    //璁剧疆鐘舵�佹枃瀛�
-                    this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                 });
                 return true;
             }
@@ -276,36 +273,30 @@
                 ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
                 //鍙樻洿鍗$墖鐘舵��
                 this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
-                //璁剧疆鐘舵�佹枃瀛�
-                this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                 return;
             }
             //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
             this.StartCheckResponeResult(this.listControl, (result) =>
             {
-                //娌℃湁鎺ユ敹鍒扮綉鍏冲洖澶�
-                if (result == false)
+                //鎺ユ敹鍒扮綉鍏冲洖澶�
+                if (result == true)
                 {
                     HdlThreadLogic.Current.RunMain(() =>
-                    {             
-                        //璁剧疆鐘舵�佹枃瀛�
-                        this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
+                    {
+                        //鍙樻洿鍗$墖鐘舵��
+                        bool statu = ((LightBase)this.device).OnOffStatus == 1;
+                        this.RefreshSwitchStatu(statu);
                     });
                 }
             });
-            //鍙樻洿鍗$墖鐘舵��
-            this.RefreshSwitchStatu(isOpen);
-
             if (isOpen == true)
             {
                 //鎵撳紑
-                this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
                 this.device.SwitchControl(1);
             }
             else
             {
                 //鍏抽棴
-                this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
                 this.device.SwitchControl(0);
             }
         }

--
Gitblit v1.8.0