From dce6c3481a37216292724013ff9d2b75ceb82f86 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 10 六月 2020 15:47:28 +0800
Subject: [PATCH] 添加小度的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs |   69 ++++++++++++----------------------
 1 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
index c2a0213..c2b0eba 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
@@ -32,48 +32,6 @@
             }
         }
 
-        /// <summary>
-        /// 鎺у埗寤舵椂榛樿鍙嶉鐨勭嚎绋嬪垪琛�
-        /// </summary>
-        private List<System.Threading.Thread> ListThreads = new List<System.Threading.Thread> { };
-
-        #endregion
-
-        #region 鈻� 鍙戦�佹帶鍒跺懡浠ゅ欢鏃跺弽棣坃______________
-
-        /// <summary>
-        /// 鍙戦�佹帶鍒跺懡浠ゅ欢鏃跺弽棣�
-        /// </summary>
-        /// <param name="commonDevice">Common device.</param>
-        /// <param name="action">Action.</param>
-        /// <param name="delayTime">Delay time.</param>
-        public void SendCommandDelayAction(CommonDevice commonDevice, Action action, int delayTime = 3)
-        {
-            var threadName = commonDevice.GetHashCode().ToString();
-            if (ListThreads.Find((obj) => obj.Name == threadName) == null)
-            {
-                var thread = new System.Threading.Thread(() =>
-                {
-                    var dateTime = DateTime.Now;
-                    while ((DateTime.Now - dateTime).TotalSeconds < delayTime)
-                    {
-                        System.Threading.Thread.Sleep(100);
-                    }
-                    lock (ListThreads)
-                    {
-                        ListThreads.RemoveAll((obj) => obj.Name == threadName);
-                    }
-                    action?.Invoke();
-                })
-                { IsBackground = true, Name = threadName };
-                lock (ListThreads)
-                {
-                    ListThreads.Add(thread);
-                }
-                thread.Start();
-            }
-        }
-
         #endregion
 
         #region 鈻� 鏄剧ず鎺у埗璁惧鏄惁鎴愬姛鐨勬彁绀篲________
@@ -140,6 +98,19 @@
                     return Language.StringByID(R.MyInternationalizationString.Close);
                 }
                 return $"{(int)((device as DimmableLight).Level * 1.0 / 254 * 100)}%";
+            }
+            else if (device.Type == DeviceType.ColorTemperatureLight)
+            {
+                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
+                if (device.HadReadDeviceStatu == false)
+                {
+                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
+                }
+                if ((device as ColorTemperatureLight).OnOffStatus == 0)
+                {
+                    return Language.StringByID(R.MyInternationalizationString.Close);
+                }
+                return $"{(int)((device as ColorTemperatureLight).Level * 1.0 / 254 * 100)}%";
             }
             else if (device.Type == DeviceType.WindowCoveringDevice)
             {
@@ -333,9 +304,9 @@
                     //鐕冩皵
                     if (ias.iASInfo?.Alarm1 == 1)
                     {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
+                        return Language.StringByID(R.MyInternationalizationString.uGasLeakage);
                     }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe);
+                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
                 }
                 else if (info.ConcreteType == DeviceConcreteType.Sensor_Fire)
                 {
@@ -382,7 +353,15 @@
                     }
                     return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
                 }
-                return null;
+                else
+                {
+                    //鍏朵粬浼犳劅鍣�
+                    if (ias.iASInfo?.Alarm1 == 1)
+                    {
+                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
+                    }
+                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
+                }
             }
             else if (device.Type == DeviceType.TemperatureSensor)
             {

--
Gitblit v1.8.0