From 94e4e5b9fd3da964c44b7b14227d6fe2bbb426d7 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 02 四月 2020 13:56:39 +0800 Subject: [PATCH] 2020-04-02-2 --- ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs | 28 +++++++++++----------------- 1 files changed, 11 insertions(+), 17 deletions(-) diff --git a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs index 15739d4..12d007b 100755 --- a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs +++ b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs @@ -1,6 +1,7 @@ 锘縰sing System; using System.Collections.Generic; using System.Globalization; +using ZigBee.Device; using static ZigBee.Device.Scene; namespace Shared.Common @@ -24,7 +25,7 @@ /// 閫夋嫨鐨勮澶� /// Type=0 瀛樺湪 /// </summary> - public DeviceUI DeviceUI = new DeviceUI(); + public CommonDevice DeviceUI = new CommonDevice(); /// <summary> /// Type=0銆�1銆�2 瀛樺湪 @@ -56,13 +57,7 @@ /// 鍞竴鏍囪瘑--HashCode /// DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo) /// </summary> - public string SceneTargetDeviceUIID - { - get - { - return GetHashCode().ToString(); - } - } + public string SceneTargetDeviceUIID = Guid.NewGuid().ToString(); /// <summary> /// GetDeviceStatu @@ -70,7 +65,7 @@ /// <returns></returns> public string GetDeviceStatu() { - if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput) + if (DeviceUI.Type == ZigBee.Device.DeviceType.OnOffOutput) { if (TaskList.Count == 0) { @@ -82,7 +77,7 @@ } return Language.StringByID(R.MyInternationalizationString.Shut); } - else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch) + else if (DeviceUI.Type == ZigBee.Device.DeviceType.AirSwitch) { if (TaskList.Count == 0) { @@ -94,7 +89,7 @@ } return Language.StringByID(R.MyInternationalizationString.Shut); } - else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight) + else if (DeviceUI.Type == ZigBee.Device.DeviceType.DimmableLight) { if (TaskList.Count == 0) { @@ -106,19 +101,19 @@ } return $"{(int)(TaskList[0].Data1 * 1.0 / 254 * 100)}%"; } - else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice) + else if (DeviceUI.Type == ZigBee.Device.DeviceType.WindowCoveringDevice) { if (TaskList.Count == 0) { return null; } - if (TaskList[0].Data1 == 0) + if (TaskList[0].Data1 == 1) { return Language.StringByID(R.MyInternationalizationString.Shut); } - return $"{TaskList[0].Data1}%"; + return $"{TaskList[0].Data2}%"; } - else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat) + else if (DeviceUI.Type == ZigBee.Device.DeviceType.Thermostat) { //娓╁害锛屾ā寮忥紝椋庨�� string tempareture = string.Empty; @@ -159,7 +154,7 @@ } else if(taskListInfo.Data1==4 || taskListInfo.Data1==5) { - tempareture = $"{ taskListInfo.Data2} 鈩�"; + tempareture = $"{ taskListInfo.Data2/100} 鈩�"; } else if (taskListInfo.Data1 == 6) { @@ -179,7 +174,6 @@ } return $"{tempareture},{model},{wind}"; } - else { return null; -- Gitblit v1.8.0