| | |
| | | else if (report.DeviceStatusReport.CluterID == 8)
|
| | | {
|
| | | locadevice.DeviceStatusReport = report.DeviceStatusReport;
|
| | | if (locadevice.Type == DeviceType.DimmableLight && report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
|
| | | if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
|
| | | {
|
| | | //此属性表明当前亮度程度
|
| | | ((DimmableLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
|
| | | if (locadevice.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | //此属性表明当前亮度程度
|
| | | ((DimmableLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
|
| | | }
|
| | | else if (locadevice.Type == DeviceType.ColorTemperatureLight)
|
| | | {
|
| | | //此属性表明当前亮度程度
|
| | | ((ColorTemperatureLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
|
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 色温数据
|
| | | //色温数据
|
| | | else if (report.DeviceStatusReport.CluterID == 768)
|
| | | {
|
| | | locadevice.DeviceStatusReport = report.DeviceStatusReport;
|
| | | if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
|
| | | {
|
| | | if (locadevice.Type == DeviceType.ColorTemperatureLight)
|
| | | {
|
| | | //此属性表明当前色温
|
| | | ((ColorTemperatureLight)locadevice).ColorTemperature = report.DeviceStatusReport.AttriBute[0].AttriButeData;
|
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | }
|
| | |
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
|
| | | }
|
| | | //温度传感器
|
| | | //湿度传感器
|
| | | if (locadevice is TemperatureSensor)
|
| | | {
|
| | | ((TemperatureSensor)locadevice).Humidity = humidity;
|
| | | }
|
| | | //新风的湿度传感器
|
| | | else if (locadevice is HumiditySensor)
|
| | | {
|
| | | ((HumiditySensor)locadevice).Humidity = humidity;
|
| | | }
|
| | | //PM2.5传感器
|
| | | else if (locadevice is PMSensor)
|
| | | {
|