| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 电量推送
|
| | | //电量推送
|
| | | if (report.DeviceStatusReport.CluterID == 1)
|
| | | {
|
| | | foreach (var attData in report.DeviceStatusReport.AttriBute)
|
| | | {
|
| | | //电量
|
| | | if (attData.AttributeId == 33)
|
| | | {
|
| | | string receiptData = string.Empty;
|
| | | //两个两个位置替换
|
| | | for (int i = attData.AttriButeDataHex.Length - 1; i >= 0; i = i - 2)
|
| | | {
|
| | | receiptData += attData.AttriButeDataHex[i - 1].ToString() + attData.AttriButeDataHex[i].ToString();
|
| | | }
|
| | | int batteryValue = Convert.ToInt32(receiptData, 16);
|
| | | //低于20%,则代表电量低
|
| | | locadevice.IsBatteryDown = batteryValue < 20;
|
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 窗帘数据
|
| | | //窗帘数据
|
| | | else if (report.DeviceStatusReport.CluterID == 258)
|