From 5eec2e8c16bdcb163b388de486ee375e891df445 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 25 二月 2021 17:54:15 +0800
Subject: [PATCH] 2021-2-25-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs |   34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
index 17262bf..4ec37d4 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -35,16 +35,42 @@
         /// 閬ユ帶鍣ㄧ孩澶栫爜瀛︿範
         /// </summary>
         /// <returns></returns>
-        public static ResponsePackNew CodeStudy(ButtonObj buttonObj)
+        public static void CodeStudy(ButtonObj buttonObj, Action<ResponsePackNew> action)
         {
+            //var whichDayJson = jay["whichDay"].ToString();
+            //var whichDayAry = Newtonsoft.Json.Linq.JArray.Parse(whichDayJson);
+            //for (int b = 0; b < whichDayAry.Count; b++)
+            //{
+            //    var days = whichDayAry[b].ToString();
+            //    timer.whichDay.Add(int.Parse(days));
+            //}
+
             var jArray = new JArray { };
             var job = new JObject { };
             job.Add("key", buttonObj.Key);
             job.Add("value", buttonObj.value);
             jArray.Add(job);
-            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", "0" }, { "status", jArray } };
-            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy);
-            return responsePackNew;
+            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", "0" }, { "attributes", jArray } };
+            ResponsePackNew responsePackNew = null;
+            new System.Threading.Thread(() =>
+            {
+
+                try
+                {
+                    //鍙戦�佺孩澶栫爜瀛︿範鍛戒护
+                    responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy);
+                }
+                catch { }
+                finally
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        action(responsePackNew);
+                    });
+                }
+
+            })
+            { IsBackground = true }.Start();
         }
         /// <summary>
         /// 鑾峰彇閫昏緫

--
Gitblit v1.8.0