From adc150efb13a0506f45a3c344c3ee2ef2dba8e90 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 七月 2021 15:19:13 +0800
Subject: [PATCH] 合并嘉乐lc代码

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

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
index 8099160..f140aab 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -33,9 +33,15 @@
         {
             get
             {
-                return Entity.DB_ResidenceData.Instance.CurrentRegion.RegionID;
+                return Entity.DB_ResidenceData.Instance.CurrentRegion.id;
             }
         }
+
+        /// <summary>
+        /// 涔愭subAccessToken
+        /// </summary>
+        public static string LcSubAccessToken = "";
+
         /// <summary>
         /// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹�
         /// </summary>
@@ -43,7 +49,7 @@
         {
             get
             {
-                return Entity.DB_ResidenceData.Instance.CurrentRegion.IsOthreShare;
+                return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare;
             }
         }
         /// <summary>
@@ -79,9 +85,9 @@
         /// <summary>
         /// 鑾峰彇閬ユ帶鍣ㄥ垪琛�
         /// </summary>
-        public static ResponsePackNew ControlList(Pir pir)
+        public static ResponsePackNew ControlList(string deviceId)
         {
-            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", pir.deviceId } };
+            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", deviceId} };
             var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_List);
             return responsePackNew;
         }
@@ -150,7 +156,7 @@
         /// 绾㈠鐮佸涔�
         /// </summary>
         /// <returns></returns>
-        public static void CodeStudy(Control control,AttributesStatus buttonObj,Action<ResponsePackNew> action)
+        public static void CodeStudy(Control control, AttributesStatus buttonObj, Action<Cloud> action)
         {
             var job = new JObject { };
             job.Add("key", buttonObj.key);
@@ -161,21 +167,32 @@
             var jArray = new JArray { };
             jArray.Add(job);
             var jObject = new JObject { { "homeId", HomeId }, { "deviceId", control.deviceId }, { "attributes", jArray } };
-            ResponsePackNew responsePackNew = null;
+            Cloud cloud = null;
             new System.Threading.Thread(() =>
             {
 
                 try
                 {
                     //鍙戦�佺孩澶栫爜瀛︿範鍛戒护
-                    responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy);
+                    var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy);
+                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
+                    {
+                        PirMethod method = new PirMethod();
+                        PirMethod.buttondata = "";
+                        cloud = method.MqttDate("鎸夐敭", control.sid, 25);
+                    }
+                    else
+                    {
+                        PirMethod method = new PirMethod();
+                        method.ErrorShow(responsePackNew, "");
+                    }
                 }
                 catch { }
                 finally
                 {
                     Application.RunOnMainThread(() =>
                     {
-                        action(responsePackNew);
+                        action(cloud);
                     });
                 }
 
@@ -267,7 +284,6 @@
             { IsBackground = true }.Start();
 
         }
-
         /// <summary>
         ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛� 
         /// </summary>

--
Gitblit v1.8.0