New file |
| | |
| | | using System; |
| | | using Newtonsoft.Json.Linq; |
| | | |
| | | namespace ZigBee.Device |
| | | { |
| | | [System.Serializable] |
| | | public class CurtainBase : CommonDevice |
| | | { |
| | | #region 开关 |
| | | ///<summary > |
| | | ///窗帘开关停控制 |
| | | /// <para>command的值</para> |
| | | ///<para>0 : 窗帘设备上拉或打开窗帘</para> |
| | | ///<para>1: 窗帘设备下降或关闭窗帘</para> |
| | | ///<para>2:窗帘设备停止窗帘转动</para> |
| | | /// </summary> |
| | | public void CurtainUpDownStopControl(int command) |
| | | { |
| | | var jobject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 258 }, { "Command", command }, { "SendMode", 2 } }; |
| | | Gateway?.Send("DeviceControl", jobject.ToString()); |
| | | System.Console.WriteLine("CurtainOpenControl_发送数据" + "_" + jobject.ToString() + "_" + System.DateTime.Now.ToString()); |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 读取窗帘设备类型 |
| | | /// <para>AttriButeId=0 (先调用发现属性接口,查看设备是否支持该接口的属性)</para> |
| | | /// <para>0:卷帘</para> |
| | | /// <para>4:开合帘</para> |
| | | /// </summary> |
| | | public void ReadWcdType() |
| | | { |
| | | ReadAttri(Device.Cluster_ID.WindowCovering, AttriButeId.WindowCoveringType); |
| | | } |
| | | } |
| | | } |