| | |
| | | /// 被绑目标是PM2.5 |
| | | /// </summary> |
| | | private CommonDevice bindPMDev; |
| | | // <summary> |
| | | /// 按键中被绑定的目标列表 |
| | | /// </summary> |
| | | public List<BindObj.BindListResponseObj> bindList = new List<BindObj.BindListResponseObj>(); |
| | | |
| | | #endregion |
| | | |
| | |
| | | var panelBindListRes = await curControlDev.GetDeviceBindAsync(); |
| | | if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null) |
| | | { |
| | | foreach (var bDev in panelBindListRes.getAllBindResponseData.BindList) |
| | | bindList = panelBindListRes.getAllBindResponseData.BindList; |
| | | foreach (var bDev in bindList) |
| | | { |
| | | curControlDev.bindList.Add(bDev); |
| | | var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); |
| | | |
| | | if (device.Type == DeviceType.FreshAir) |
| | |
| | | { |
| | | continue; |
| | | } |
| | | bindFreshAirName = device.DeviceEpointName; |
| | | if (string.IsNullOrEmpty(bDev.ESName)) |
| | | { |
| | | bindFreshAirName = device.DeviceEpointName; |
| | | } |
| | | else |
| | | { |
| | | bindFreshAirName = bDev.ESName; |
| | | } |
| | | |
| | | bindFreshAirDev = device; |
| | | } |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | |
| | | var bD = device as TemperatureSensor; |
| | | if (bD.SensorDiv == 1) |
| | | { |
| | | bindTemperatureName = device.DeviceEpointName; |
| | | if (string.IsNullOrEmpty(bDev.ESName)) |
| | | { |
| | | bindTemperatureName = device.DeviceEpointName; |
| | | } |
| | | else |
| | | { |
| | | bindTemperatureName = bDev.ESName; |
| | | } |
| | | bindTemperatureDev = device; |
| | | } |
| | | if (bD.SensorDiv == 2) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | if (string.IsNullOrEmpty(bDev.ESName)) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | } |
| | | else |
| | | { |
| | | bindHumidityName = bDev.ESName; |
| | | } |
| | | |
| | | bindHumidityDev = device; |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | if (string.IsNullOrEmpty(bDev.ESName)) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | } |
| | | else |
| | | { |
| | | bindHumidityName = bDev.ESName; |
| | | } |
| | | |
| | | bindHumidityDev = device; |
| | | } |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | bindPmName = device.DeviceEpointName; |
| | | bindPMDev = device; |
| | | if (bDev.BindCluster == 1026) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | bindTemperatureDev = device; |
| | | } |
| | | if (bDev.BindCluster == 1029) |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | bindHumidityDev = device; |
| | | } |
| | | if (bDev.BindCluster == 1066) |
| | | { |
| | | if (string.IsNullOrEmpty(bDev.ESName)) |
| | | { |
| | | bindPmName = device.DeviceEpointName; |
| | | } |
| | | else |
| | | { |
| | | bindPmName = bDev.ESName; |
| | | } |
| | | |
| | | bindPMDev = device; |
| | | } |
| | | } |
| | | } |
| | | result = true; |