wei
2021-08-27 eda3fb873e59544ff36301b51e05aef64f87b0f9
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -33,9 +33,16 @@
        {
            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 +50,7 @@
        {
            get
            {
                return Entity.DB_ResidenceData.Instance.CurrentRegion.IsOthreShare;
                return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare;
            }
        }
        /// <summary>
@@ -150,7 +157,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 +168,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 +285,6 @@
            { IsBackground = true }.Start();
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId) 
        /// </summary>