From 76e6d851ef5a8d3a2a9a1f2a3f90b74dd31eae86 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 14 六月 2023 20:32:35 +0800 Subject: [PATCH] 渐变时间修复发送 --- HDL_ON/Entity/Function/Function.cs | 39 ++++++++++++++++++++++++++++++++++----- 1 files changed, 34 insertions(+), 5 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 18c0920..267a286 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -780,6 +780,31 @@ } } + string us = ""; + switch (attr.key) + { + case FunctionAttributeKey.SetTemp: + case FunctionAttributeKey.RoomTemp: + us = "掳C"; + var tempType = attributes.Find((obj) => obj.key == FunctionAttributeKey.TempType); + if (tempType != null) + { + us = tempType.curValue.ToString(); + } + break; + case FunctionAttributeKey.Percent: + case FunctionAttributeKey.Brightness: + us = "%"; + break; + case FunctionAttributeKey.CCT: + us = "K"; + break; + case FunctionAttributeKey.Angle: + us = "掳"; + break; + } + + switch (attr.key) { case FunctionAttributeKey.OnOff: @@ -834,11 +859,15 @@ { vv = 26; } - sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString(), max = attr.max, min = attr.min }); + sFunc.status.Add(new SceneFunctionStatus() { + UintString = us, + key = attr.key, value = Convert.ToInt32(vv).ToString(), max = attr.max, min = attr.min }) ; } else { - sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString(), max = attr.max, min = attr.min }); + sFunc.status.Add(new SceneFunctionStatus() { + UintString = us, + key = attr.key, value = attr.curValue.ToString(), max = attr.max, min = attr.min }); } break; @@ -1681,9 +1710,9 @@ /// </summary> public const string SensorPir = "sensor.pir"; /// <summary> - /// 浜轰綋绉诲姩浼犳劅鍣紙甯︽寔缁椂闂达級 + /// 浜轰綋瀛樺湪浼犳劅鍣� /// </summary> - public const string sensorPirhold = "sensor.pir_hold"; + public const string SensorPirHold = "sensor.pir_hold"; /// <summary> /// 锛堥棬绐椾紶鎰熷櫒锛� /// </summary> @@ -1738,8 +1767,8 @@ { var spkList = new List<string>(); //spkList.Add(SensorLight); - spkList.Add(sensorPirhold); spkList.Add(SensorPir); + spkList.Add(SensorPirHold); spkList.Add(SensorHelp); spkList.Add(SensorDoorWindow); spkList.Add(SensorSmoke); -- Gitblit v1.8.0