From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs | 62 ++++++++++++++++++++++++++++++-
1 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
index 598fe28..6fda75c 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -239,7 +239,7 @@
}
new System.Threading.Thread(() =>
{
- SendPmSensorStatuComand(device);
+ SendPm2P5Comand(device);
//璇诲彇Pm2.5浼犳劅鍣ㄧ殑娓╁害鏁版嵁
HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device);
//璇诲彇Pm2.5浼犳劅鍣ㄧ殑婀垮害鏁版嵁
@@ -253,7 +253,7 @@
/// SendFanStatuComand
/// </summary>
/// <param name="device">璁惧</param>
- private void SendPmSensorStatuComand(CommonDevice device)
+ private void SendPm2P5Comand(CommonDevice device)
{
if (device == null)
{
@@ -280,6 +280,64 @@
#endregion
+ #region 鈻� 绌烘皵璐ㄩ噺浼犳劅鍣╛______________________________
+ /// <summary>
+ /// SendAirQualitySensorComand
+ /// </summary>
+ /// <param name="device">璁惧</param>
+ public void SendAirQualitySensorComand(CommonDevice device)
+ {
+ if (device == null)
+ {
+ return;
+ }
+ new System.Threading.Thread(() =>
+ {
+ SendSwitchStatuComand(device);
+ //绌烘皵璐ㄩ噺浼犳劅鍣ㄧ殑PM2.5鏁版嵁
+ SendPm2P5Comand(device);
+ //绌烘皵璐ㄩ噺浼犳劅鍣ㄧ殑CO2鏁版嵁[2021.01.13浜у搧瑕佹眰鏆傛椂鍘绘帀]
+ //SendCO2Comand(device);
+ //绌烘皵璐ㄩ噺浼犳劅鍣ㄧ殑娓╁害鏁版嵁
+ HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device);
+ //绌烘皵璐ㄩ噺浼犳劅鍣ㄧ殑婀垮害鏁版嵁
+ HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(device);
+ System.Threading.Thread.Sleep(300);
+ })
+ { IsBackground = true }.Start();
+ }
+
+ /// <summary>
+ /// SendCO2Comand
+ /// </summary>
+ /// <param name="device">璁惧</param>
+ private void SendCO2Comand(CommonDevice device)
+ {
+ if (device == null)
+ {
+ return;
+ }
+ var jObject = new Newtonsoft.Json.Linq.JObject
+ {
+ { "DeviceAddr",device.DeviceAddr },
+ { "Epoint", device.DeviceEpoint },
+ { "Cluster_ID", (int)Cluster_ID.CO2},
+ { "Command", 108 }
+ };
+ var attriBute = new Newtonsoft.Json.Linq.JArray
+ {
+ new Newtonsoft.Json.Linq.JObject
+ {
+ { "AttriButeId", (int)AttriButeId.MeasuredValue}
+ }
+ };
+ var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
+ jObject.Add("Data", data);
+ device.Gateway?.Send("GetDeviceStatus", jObject.ToString());
+ }
+
+ #endregion
+
#region 鈻� 鏅捐。鏋禵______________________________
/// <summary>
/// SendAirerComand
--
Gitblit v1.8.0