From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs index 950b2fa..6dcd028 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs @@ -22,10 +22,16 @@ public int Level = 0; /// <summary> - ///鑹叉俯锛屽彇鍊艰寖鍥达細3400~6000 + ///鑹叉俯锛屽彇鍊艰寖鍥达細3000~6000(杩欓噷璁板綍鐨勫�肩殑鍗曚綅鏄� 鍗�) /// </summary> [Newtonsoft.Json.JsonIgnore] public int ColorTemperature = 0; + + /// <summary> + ///铚傞福鍣ㄦ槸鍚﹀湪鍝嶇潃(true:鍝嶇潃 false:涓嶅搷) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public bool IsBuzzerRing = false; /// <summary> /// 璇诲彇浜害 @@ -41,6 +47,14 @@ public void ReadColorTemperature() { ReadAttri(Device.Cluster_ID.ColorControl, AttriButeId.LevelControl); + } + + /// <summary> + /// 璇诲彇铚傞福鍣ㄧ姸鎬�(灏忓鐏笓鐢�) + /// </summary> + public void ReadBuzzerStatu() + { + ReadAttri((Cluster_ID)1282, 0); } ///<summary > @@ -84,5 +98,26 @@ jObject.Add("Data", data); Gateway?.Send("DeviceControl", jObject.ToString()); } + + /// <summary> + /// 鍙戦�佹墦寮�鑾峰彇鍏抽棴铚傞福鍣ㄧ殑鍛戒护(鐩墠鍏堣繖鏍峰惂,灏忓鐏殑铚傞福鍣�) + /// </summary> + /// <param name="isOpen"></param> + public void SendBuzzerSwitchControl(bool isOpen) + { + var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 1282 }, { "Command", 0 } }; + var data = new JObject { + { "WarningMode", isOpen==true?1:0 },//0:鍏抽棴鎶ヨ 1:鎵撳紑鎶ヨ + { "Strobe", 0 },//鏄惁鍚姩鎶ヨ鐏� 0:涓嶅惎鍔� 1:鍚姩 + { "SirenLevel", 0 },//鎶ヨ闊抽噺 0锛歀ow 1锛歁edium 2锛歨igh 3: very high + { "WarningDuration", isOpen==true?10:0 }, //鎶ヨ鏃堕暱 0 -65535 鍗曚綅锛氱 + { "StrobeDutyCycle", 50 }, //鎶ヨ绛夐棯鐑佸崰绌烘瘮 0-100 + { "StrobeLevel", 1 } //鎶ヨ鐏寒搴� 0锛歀ow 1锛歁edium 2锛歨igh 3: very high + }; + jObject.Add("Data", data); + + //涓婚鍙互涔卞啓鐨� + Gateway.Send("SendSwitchCommand", jObject.ToString()); + } } } -- Gitblit v1.8.0