From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 22 六月 2022 11:22:18 +0800 Subject: [PATCH] 修改引用路径 --- 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