From 98ceb6bd2021f9ff136cda27eef28676dd7b5d92 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 21 五月 2020 13:24:02 +0800
Subject: [PATCH] 最后的版本
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs | 74 ++++++++++++++++++++++++++++++++----
1 files changed, 65 insertions(+), 9 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
index 49ce8de..2832b5d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -53,6 +53,10 @@
/// 琚粦鐩爣鏄疨M2.5
/// </summary>
private CommonDevice bindPMDev;
+ // <summary>
+ /// 鎸夐敭涓缁戝畾鐨勭洰鏍囧垪琛�
+ /// </summary>
+ public List<BindObj.BindListResponseObj> bindList = new List<BindObj.BindListResponseObj>();
#endregion
@@ -238,12 +242,12 @@
bool result = false;
//鑾峰彇闈㈡澘涓瓨鍦ㄧ殑缁戝畾鐩爣
FreshAir curControlDev = curDev as FreshAir;
- var panelBindListRes = await curControlDev.GetDeviceBindAsync();
+ var panelBindListRes = HdlDeviceBindLogic.Current.GetDeviceBindAsync(curControlDev);
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)
@@ -255,7 +259,15 @@
{
continue;
}
- bindFreshAirName = device.DeviceEpointName;
+ if (string.IsNullOrEmpty(bDev.ESName))
+ {
+ bindFreshAirName = device.DeviceEpointName;
+ }
+ else
+ {
+ bindFreshAirName = bDev.ESName;
+ }
+
bindFreshAirDev = device;
}
if (device.Type == DeviceType.TemperatureSensor)
@@ -263,24 +275,68 @@
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;
--
Gitblit v1.8.0