陈嘉乐
2020-07-10 48ba446936b51fffafa7c3600c0dadc6ac0e8c20
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -35,21 +35,29 @@
        public string currentUserDisplayMethod = string.Empty;//当前用户显示方式
        //本地所有账户列表
        public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { };
        /// <summary>
        /// 是否常开模式
        /// ture:常开; false:关闭
        /// </summary>
        public bool IsDoorLockNormallyMode = false;
        [Newtonsoft.Json.JsonIgnore]
        public string LocalTempPassword = string.Empty;//本地生成的临时密码
        public Dictionary<string, bool> IsFreezeAccount = new Dictionary<string, bool> { };//是否冻结子账户
        public Dictionary<string, bool> HasRemoteUnlockAccess = new Dictionary<string, bool> { };//是否给子账户拥有远程开锁的条件
        public Dictionary<string, bool> IsFailedToGetDoorLockInfo = new Dictionary<string, bool> { };//是否获取门锁数据失败
        [Newtonsoft.Json.JsonIgnore]
        public string RemoteUnlockPassword = string.Empty;//远程开锁密码
        public static int RemoteUnlockCount = 5;//远程开锁次数限制
        public static int failedCount = 3;//远程开锁失败次数
        public static DateTime maxValue = DateTime.MaxValue;
        public static DateTime minValue = DateTime.MinValue;
        #region 临时密码信息
        /// <summary>
        /// 用户管理发送数据回复
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public TempPasswordObject tempPasswordObject;
        /// <summary>
        /// 临时密码本地对象
@@ -654,7 +662,11 @@
            return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>>>)(async () =>
           {
               var pra = new Shared.Phone.UserCenter.MemberListInfoPra();
               string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
               string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
               if (result == null)
               {
                   return null;
               }
               var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result);
               return listInfo;
           }));
@@ -678,6 +690,7 @@
        /// <summary>
        /// 门锁操作事件通知
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public DoorLockOperatingEventNotificationCommand doorLockOperatingEventNotificationCommand;
        /// <summary>
        /// 门锁操作事件通知
@@ -921,13 +934,14 @@
            /// Unlock命令:error,invalid schedule事件
            /// </summary>
            UnlockInvalidScheduleEvent = 6,
        }
        }
        #endregion
        #region 门锁编程事件通知
        /// <summary>
        /// 门锁编程事件通知
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public DoorLockProgrammingEventNotificationCommand doorLockProgrammingEventNotificationCommand;
        /// <summary>
        /// 门锁编程事件通知
@@ -979,8 +993,8 @@
        /// <summary>
        /// 矫正门锁时间
        /// </summary>
        /// <returns>The writable value async.</returns>
        /// <param name="timestamp">矫正门锁的时间</param>
        /// <param name="timestamp"></param>
        /// <returns></returns>
        public async System.Threading.Tasks.Task<SetWritableValueResponAllData> RectifyDoorLockTimeAsync(int timestamp)
        {
            if (Gateway == null)
@@ -997,8 +1011,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -1012,7 +1025,6 @@
                    if (topic == gatewayID + "/" + "SetWritableValue_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString());
                        if (tempData == null)
@@ -1058,50 +1070,6 @@
            });
        }
        /// <summary>
        /// 网关版本信息,网关反馈信息
        /// </summary>
        public SetWritableValueResponAllData setWritableValueResponAllData;
        /// <summary>
        /// 网关版本信息,网关反馈信息
        /// </summary>
        [System.Serializable]
        public class SetWritableValueResponAllData
        {
            /// <summary>
            /// 错误信息
            /// </summary>
            public string errorMessageBase;
            /// <summary>
            /// 网关信息错误反馈
            /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para>
            /// </summary>
            public ErrorResponData errorResponData;
            /// <summary>
            /// 网关版本信息
            /// </summary>
            public SetWritableValueResponData setWritableValueResponData;
        }
        /// <summary>
        /// 设置可写属性的值的数据
        /// </summary>
        [System.Serializable]
        public class SetWritableValueResponData
        {
            /// <summary>
            /// 配置属性所在的cluster
            /// </summary>
            public int Cluster;
            /// <summary>
            /// 0:配置成功(若配置成功,下面的AttributeId字段不存在)
            ///<para>134:不支持该属性</para>
            ///<para>135:无效的属性值</para>
            ///<para>141:无效的数据类型</para>
            /// </summary>
            public int Status;
        }
        #endregion
        #endregion
@@ -1129,8 +1097,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -1144,18 +1111,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 16)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -1164,8 +1130,11 @@
                                        var tempD = new DefaultControlResponseData();
                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
                                        result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
                                        DebugPrintLog($"UI收到通知后的主题_command:0450_{ topic}");
                                        if (tempD.command == "0450")
                                        {
                                            result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
                                            DebugPrintLog($"UI收到通知后的主题_command:0450_{ topic}");
                                        }
                                    }
                                }
                            }
@@ -1369,7 +1338,6 @@
        /// <summary>
        /// 用户管理发送数据回复
        /// </summary>
        public DefaultControlResponseAllData defaultControlResponseAllData;
        [System.Serializable]
        public class DefaultControlResponseAllData
        {
@@ -1467,8 +1435,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -1482,18 +1449,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new VerifyPasswordResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 12)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -1573,7 +1539,6 @@
        /// <summary>
        /// 用户管理发送数据回复
        /// </summary>
        public VerifyPasswordResponseAllData verifyPasswordResponseAllData;
        [System.Serializable]
        public class VerifyPasswordResponseAllData
        {
@@ -1617,8 +1582,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -1643,18 +1607,17 @@
                    }
                    else if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new RemoteResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 16)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -1663,8 +1626,11 @@
                                        var tempD = new RemoteResponseData();
                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
                                        result = new RemoteResponseAllData { responseData = tempD };
                                        DebugPrintLog($"UI收到通知后的主题_command:0462_{ topic}");
                                        if (tempD.command == "0462")
                                        {
                                            result = new RemoteResponseAllData { responseData = tempD };
                                            DebugPrintLog($"UI收到通知后的主题_command:0462_{ topic}");
                                        }
                                    }
                                }
                            }
@@ -1744,7 +1710,6 @@
        /// <summary>
        ///  远程回复数据
        /// </summary>
        public RemoteResponseAllData remoteResponseAllData;
        [System.Serializable]
        public class RemoteResponseAllData
        {
@@ -1809,8 +1774,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -1824,18 +1788,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new TempPasswordResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 16)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -1844,8 +1807,11 @@
                                        var tempD = new TempPasswordResponseData();
                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
                                        result = new TempPasswordResponseAllData { responseData = tempD };
                                        DebugPrintLog($"UI收到通知后的主题_command:0463_{ topic}");
                                        if (tempD.command == "0463")
                                        {
                                            result = new TempPasswordResponseAllData { responseData = tempD };
                                            DebugPrintLog($"UI收到通知后的主题_command:0463_{ topic}");
                                        }
                                    }
                                }
                            }
@@ -1934,7 +1900,6 @@
        /// <summary>
        /// 临时密码回复数据
        /// </summary>
        public TempPasswordResponseAllData tempPasswordResponseAllData;
        [System.Serializable]
        public class TempPasswordResponseAllData
        {
@@ -2019,8 +1984,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -2035,18 +1999,17 @@
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new KeyPasswordInfo { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 20)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -2361,8 +2324,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -2376,18 +2338,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new VolumeResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 14)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -2395,7 +2356,7 @@
                                    {
                                        var tempD = new VolumeResponseData();
                                        tempD.command = data[10].ToString() + data[11].ToString();
                                        tempD.value = Convert.ToInt32(data[13].ToString(), 16);
                                        tempD.value = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16);
                                        result = new VolumeResponseAllData { volumeResponseData = tempD };
                                        DebugPrintLog($"UI收到通知后的主题_command:0456_{ topic}");
                                    }
@@ -2442,10 +2403,7 @@
        ///<summary >
        ///音量
        ///<para>命令值: comandValue</para>
        ///<para>comandValue: 0 静音</para>
        ///<para>comandValue:1 最小音量</para>
        ///<para>comandValue:2~13 音量 </para>
        ///<para>comandValue:14 最大音量</para>
        ///<para>comandValue: 0-0x64 音量</para>
        /// </summary>
        public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetVolumeAsync(int comandValue)
        {
@@ -2464,8 +2422,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -2479,18 +2436,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 16)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -2502,7 +2458,7 @@
                                        if (tempD.command == "0455")
                                        {
                                            result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
                                            DebugPrintLog($"UI收到通知后的主题_command:0456_{ topic}");
                                            DebugPrintLog($"UI收到通知后的主题_command:0455_{ topic}");
                                        }
                                    }
                                }
@@ -2547,10 +2503,7 @@
        /// <summary>
        /// 音量发送数据
        ///<para>comandValue: 0 静音</para>
        ///<para>comandValue:1 最小音量</para>
        ///<para>comandValue:2~13 音量 </para>
        ///<para>comandValue:14 最大音量</para>
        ///<para>comandValue: 0-100 音量</para>
        /// </summary>
        public string VolumeData(int comandValue)
        {
@@ -2565,16 +2518,16 @@
            {
                if (comandValue >= 1)
                {
                    //comandValue = comandValue * 100;
                    //float v = (float)100 / 15;
                    //int vv = Convert.ToInt32(v * 100);
                    //var comandValueTemp = comandValue / vv;
                    //if (comandValueTemp == 0)
                    //{
                    //    comandValueTemp = 1;
                    //}
                    cValue = Convert.ToString(comandValue, 16).ToUpper();
                    cValue = "F" + cValue;
                    if (cValue.Length == 1)
                    {
                        cValue = "0" + cValue;
                    }
                    else
                    {
                        cValue = cValue;
                    }
                }
                else
                {
@@ -2601,7 +2554,6 @@
        /// <summary>
        /// 音量回复数据
        /// </summary>
        public VolumeResponseAllData volumeResponseAllData;
        [System.Serializable]
        public class VolumeResponseAllData
        {
@@ -2664,8 +2616,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -2679,18 +2630,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new OpenModeResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 12)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -2762,8 +2712,7 @@
                    if (topic == gatewayID + "/" + "Error_Respon")
                    {
                        var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                        if (temp == null)
                        {
@@ -2777,18 +2726,17 @@
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        if (clientDataPassthroughResponseData == null)
                        {
                            result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            if (clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var data = clientDataPassthroughResponseData.PassData;
                                if (data.Length == 16)
                                {
                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
@@ -2890,7 +2838,6 @@
        /// <summary>
        /// 常开模式 回复数据
        /// </summary>
        public OpenModeResponseAllData openModeResponseAllData;
        [System.Serializable]
        public class OpenModeResponseAllData
        {