黄学彪
2020-05-19 7dd4be37cdedaf81ad40990d8cb8dce164d83f4d
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -286,6 +286,60 @@
        #endregion
        #region ■ PM2.5_______________________________
        /// <summary>
        /// SendPmSensorComand
        /// </summary>
        /// <param name="device">设备</param>
        public void SendPmSensorComand(CommonDevice device)
        {
            if (device == null)
            {
                return;
            }
            new System.Threading.Thread(() =>
            {
                SendPmSensorStatuComand(device);
                //读取Pm2.5传感器的温度数据
                HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device);
                //读取Pm2.5传感器的湿度数据
                HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(device);
                System.Threading.Thread.Sleep(300);
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// SendFanStatuComand
        /// </summary>
        /// <param name="device">设备</param>
        private void SendPmSensorStatuComand(CommonDevice device)
        {
            if (device == null)
            {
                return;
            }
            var jObject = new Newtonsoft.Json.Linq.JObject
            {
                { "DeviceAddr",device.DeviceAddr },
                { "Epoint", device.DeviceEpoint },
                { "Cluster_ID", (int)Cluster_ID.PmTwoPointFiveMeasurement  },
                { "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>
        /// 发送获取窗帘状态命令