From e747e6d8524e3146bb48dc304a713f309966b1c6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 19 五月 2020 13:10:03 +0800
Subject: [PATCH] 新版本

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
index 8c174d1..1875cda 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
@@ -101,7 +101,7 @@
             btnNote.InitControl();
             //鍒掔嚎
             btnNote.AddBottomLine();
-            btnNote.txtInput.FinishInputEvent += async () =>
+            btnNote.txtInput.FinishInputEvent += () =>
              {
                  string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
                  if (btnNote.Text.Trim() == string.Empty)
@@ -112,7 +112,7 @@
                  if (oldName != btnNote.Text)
                  {
                      //璁惧鍚嶇О淇敼
-                     var result = await Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
+                     var result = Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
                      if (result == false)
                      {
                          return;
@@ -174,9 +174,9 @@
                 string statu = btnSwingSwitch.IsSelected == true ? "0" : "1";
                 //灏嗕簩杩涘埗杞崲涓哄崄杩涘埗
                 int sendData = Convert.ToInt32(this.fixValue + statu, 2);
-                HdlThreadLogic.Current.RunThread(async () =>
+                HdlThreadLogic.Current.RunThread(() =>
                 {
-                    var result = await HdlDeviceAirConditionerLogic.Current.SetUseAcSwingFunctionStatu(deviceAc, sendData);
+                    var result = HdlDeviceAirConditionerLogic.Current.SetUseAcSwingFunctionStatu(deviceAc, sendData);
                     if (result == true)
                     {
                         HdlThreadLogic.Current.RunMain(() =>
@@ -201,13 +201,13 @@
             var btnFinish = new BottomClickButton();
             btnFinish.TextID = R.MyInternationalizationString.uSave;
             bodyFrameLayout.AddChidren(btnFinish);
-            btnFinish.ButtonClickEvent += async (sender, e) =>
+            btnFinish.ButtonClickEvent += (sender, e) =>
             {
                 string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
                 if (oldName != btnNote.Text)
                 {
                     //璁惧鍚嶇О淇敼
-                    var result = await Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
+                    var result = Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
                     if (result == false)
                     {
                         return;
@@ -267,6 +267,18 @@
         /// </summary>
         private bool ReadAirConditionerSwingModeSupport()
         {
+            //濡傛灉鏄櫄鎷熶綇瀹�
+            if (Common.Config.Instance.Home.IsVirtually == true)
+            {
+                var data = ModelData.DeviceModelDataLogic.Current.GetAcSwingModeSupport(deviceAc);
+                //杞崲涓轰簩杩涘埗
+                var value = Convert.ToString(data, 2).PadLeft(16, '0');
+                //杩欎釜璁剧疆鏄斁鍦ㄥ悗闈㈢殑
+                this.fixValue = value.Substring(0, value.Length - 1);
+                this.swingMode = Convert.ToInt32(value.Substring(this.fixValue.Length));
+                return true;
+            }
+
             string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(deviceAc);
             HdlGatewayReceiveLogic.Current.AddAttributeEvent("ReadAirConditionerModeSupport", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
             {

--
Gitblit v1.8.0