From f14dcfd967404e197e7ec995ca8d6f2b090d3b7d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 11 九月 2020 09:16:59 +0800
Subject: [PATCH] 优化多功能面板:绑定温湿度传感器目标,和设备列表回路显示。优化数据矫正功能温湿度度不设置的情况。优化门锁时间设置最后一天和最后最后一个月的时间显示等 细节

---
 ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs
new file mode 100755
index 0000000..e228756
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs
@@ -0,0 +1,85 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Newtonsoft.Json.Linq;
+namespace ZigBee.Device
+{
+    public class DimmableLight : LightBase
+    {
+        public DimmableLight()
+        {
+            this.Type = DeviceType.DimmableLight;
+        }
+        /// <summary>
+        ///浜害锛屾暣褰紝鍙栧�艰寖鍥达細0-254琛ㄧず0%-100% 
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public int Level = 0;
+
+        /// <summary>
+        /// 璇诲彇浜害
+        /// </summary>
+        public void ReadLevel()
+        {
+            ReadAttri(Device.Cluster_ID.LevelControl, AttriButeId.LevelControl);
+        }
+
+        ///<summary >
+        ///璁剧疆璁惧浜害锛圠evel锛�
+        ///<para>value:浜害鍊煎彇鍊艰寖鍥达細0-254</para>
+        ///<para>command 0锛歁ove to Level Command</para>
+        /// </summary>
+        public void SetLevel(int value)
+        {
+            var jObject = new JObject {
+                { "DeviceAddr", DeviceAddr},
+                { "Epoint", DeviceEpoint},
+                    { "Cluster_ID", 8 },
+                    { "Command", 4},
+                    { "SendMode", 2 }
+                };
+            var data = new JObject {
+                    { "Level", value },
+                    { "TransitionTime", 0 }
+                };
+            jObject.Add("Data", data);
+            Gateway?.Send("DeviceControl", jObject.ToString());
+         }
+
+        /////<summary >
+        /////璋冭妭浜害澶у皬 
+        /////<para>command  1 :Move Command; 5:Move to Level Command锛坵ith On/ Off锛�</para>
+        /////<para>moveMode:0: Up mode , Level 鍙樺ぇ</para>
+        /////<para>moveMode 1锛欴own mode , Level鍙樺皬</para>
+        ///// </summary>
+        //public void MoveLevel(int moveMode, int command = 5)
+        //{
+        //    var jobject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 8 }, { "Command", command }, { "SendMode", 2 } };
+        //    var data = new JObject { { "MoveMode", moveMode }, { "Rate", 100 } };
+        //    jobject.Add("Data", data);
+        //    Gateway?.Send("DeviceControl", jobject.ToString());
+        //}
+
+        /////<summary >
+        /////Move Level Command
+        /////<para>command 2: Move Command;6锛歁ove to Level Command锛坵ith On/ Off锛�</para>
+        // ///<para>StepMode:0 Up mode , Level 鍙樺ぇ</para>
+        /////<para>StepMode:1 Down mode , Level鍙樺皬</para>
+        ///// </summary>
+        //public void StepLevel(int StepMode, int command = 6)
+        //{
+            //var jobject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 8 }, { "Command", command }, { "SendMode", 2 } };
+            //var data = new JObject { { "StepMode", StepMode }, { "StepSize", 50 }, { "TransitionTime", 0 } };
+            //jobject.Add("Data", data);
+            //Gateway?.Send("DeviceControl", jobject.ToString());
+        //}
+
+        ///<summary >
+        ///鍋滄浜害璋冭妭
+        /// </summary>
+        //public void StopLevel()
+        //{
+        //    var jobject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 8 }, { "Command", 3 }, { "SendMode", 2 } };
+        //    Gateway?.Send("DeviceControl", jobject.ToString());
+        //}
+    }
+}

--
Gitblit v1.8.0