From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 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..169cad3 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -79,9 +79,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 +150,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 +161,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() != "")
+ {
+ Method method = new Method();
+ Method.buttondata = "";
+ cloud = method.MqttDate("鎸夐敭", control.sid, 25);
+ }
+ else
+ {
+ Method method = new Method();
+ method.ErrorShow(responsePackNew, "");
+ }
}
catch { }
finally
{
Application.RunOnMainThread(() =>
{
- action(responsePackNew);
+ action(cloud);
});
}
@@ -267,7 +278,6 @@
{ IsBackground = true }.Start();
}
-
/// <summary>
///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛�
/// </summary>
--
Gitblit v1.8.0