HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-07-24 0087dd7734e71dfcfd1bb54db394ad7855021ffd
新版本
1个文件已删除
50个文件已修改
1078 ■■■■■ 已修改文件
ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Resources/drawable/Loading.png 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Home.Ios/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Home.Ios/Resources/DeviceName.ini 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/CommonPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/Device.cs 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserView/HomePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Shared.projitems 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini
@@ -105,6 +105,9 @@
MGCD01/M-ZB.10 = 1306 / 吸顶式燃气传感器 / 吸顶式燃气传感器 / 1200 / 传感器 / 传感器
;PM2.5空气质量传感器 
MSPM25/M-ZB.10 = 1307 / PM2.5空气质量传感器 / PM2.5空气质量传感器 / 1307 / 空气质量 / 传感器
;温湿度传感器(这个东西好像有两个)
MTH01/M-ZB.10 = 1308 / 温湿度传感器 / 温湿度传感器 / 1200 / 传感器 / 传感器
MSHIM01/M-ZB.10 = 1308 / 温湿度传感器 / 温湿度传感器 / 1200 / 传感器 / 传感器
;***************************************************************
;                           继电器设备
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120071701" android:installLocation="auto" android:versionName="1.1.0120071701">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120072302" android:installLocation="auto" android:versionName="1.1.0120072302">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" />
    <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
ZigbeeApp/GateWay.Droid/Resources/drawable/Loading.png

ZigbeeApp/Home.Ios/Info.plist
@@ -54,9 +54,9 @@
    <key>aps-environment</key>
    <string>development</string>
    <key>CFBundleShortVersionString</key>
    <string>1.1.012007061</string>
    <string>1.1.012007231</string>
    <key>CFBundleVersion</key>
    <string>202007061</string>
    <string>202007231</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
ZigbeeApp/Home.Ios/Resources/DeviceName.ini
@@ -105,6 +105,9 @@
MGCD01/M-ZB.10 = 1306 / 吸顶式燃气传感器 / 吸顶式燃气传感器 / 1200 / 传感器 / 传感器
;PM2.5空气质量传感器 
MSPM25/M-ZB.10 = 1307 / PM2.5空气质量传感器 / PM2.5空气质量传感器 / 1307 / 空气质量 / 传感器
;温湿度传感器(这个东西好像有两个)
MTH01/M-ZB.10 = 1308 / 温湿度传感器 / 温湿度传感器 / 1200 / 传感器 / 传感器
MSHIM01/M-ZB.10 = 1308 / 温湿度传感器 / 温湿度传感器 / 1200 / 传感器 / 传感器
;***************************************************************
;                           继电器设备
ZigbeeApp/Shared/Common/CommonPage.cs
old mode 100755 new mode 100644
@@ -42,7 +42,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string CodeIDString = "1.1.0120072102";
        public static string CodeIDString = "1.1.012007231";
        /// <summary>
        /// 注册来源(0:HDL On 1:Zigbee)
        /// </summary>
@@ -378,7 +378,7 @@
                    DeviceType = deviceType
                };
                var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(RegIDObj);
                var reverObj = CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/SignZigbeeNeedPushRegID", System.Text.Encoding.UTF8.GetBytes(requestJson));
                var reverObj = CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/SignZigbeeNeedPushRegID", System.Text.Encoding.UTF8.GetBytes(requestJson), 4);
                if (reverObj == null)
                {
                    //调试:记录极光ID
ZigbeeApp/Shared/Common/Device.cs
@@ -267,22 +267,8 @@
                    listDriveDevice.Add(device);
                }
            }
            if (listDriveDevice.Count > 0)
            {
                //如果虚拟设备还没有名字的话
                HdlThreadLogic.Current.RunThread(() =>
                {
                    //如果不这样放在一个线程里,有可能对Dictionary产生影响
                    foreach (var myDevice in listDriveDevice)
                    {
                        //根据设备类型获取名称
                        var dName = this.GetDeviceObjectText(new List<CommonDevice>() { myDevice }, false);
                        //在端点名字的后面附加【回路】字样
                        dName += "(" + myDevice.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
                        this.ReName(myDevice, dName, ShowErrorMode.NO);
                    }
                });
            }
            //设置虚拟设备的默认名字
            this.SetDriveDeviceDefultName(listDriveDevice);
            //只有完全获取的时候,才会去处理删除的问题
            if (statu != 1)
@@ -532,6 +518,42 @@
                }
            }
            return true;
        }
        /// <summary>
        /// 设置虚拟设备的默认名字
        /// </summary>
        /// <param name="listDriveDevice">虚拟设备列表</param>
        private void SetDriveDeviceDefultName(List<CommonDevice> listDriveDevice)
        {
            if (listDriveDevice.Count == 0)
            {
                return;
            }
            //如果虚拟设备还没有名字的话
            HdlThreadLogic.Current.RunThread(() =>
            {
                //如果不这样放在一个线程里,有可能对Dictionary产生影响
                foreach (var myDevice in listDriveDevice)
                {
                    string dName = string.Empty;
                    if (this.IsMiniLight(myDevice) == true)
                    {
                        //Mini夜灯
                        dName = Language.StringByID(R.MyInternationalizationString.uMiniNightLight);
                    }
                    else
                    {
                        //根据设备类型获取名称
                        dName = this.GetDeviceObjectText(new List<CommonDevice>() { myDevice }, false);
                        //在端点名字的后面附加【回路】字样
                        dName += "(" + myDevice.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
                    }
                    this.ReName(myDevice, dName, ShowErrorMode.NO);
                    System.Threading.Thread.Sleep(100);
                }
            });
        }
        ///<summary >
@@ -847,9 +869,9 @@
                //门锁没有定位功能
                return false;
            }
            var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
            if (device.Type == DeviceType.IASZone)
            {
                var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
                if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_Pir)
                {
                    //传感器除了Pir都没有定位功能
@@ -860,6 +882,11 @@
                    //球型移动传感器虽然是电池设备,但是它有定位功能
                    return true;
                }
                return false;
            }
            //温湿度传感器没有定位功能
            if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatrueHumidity)
            {
                return false;
            }
@@ -1854,7 +1881,8 @@
                info.ObjectTypeName = this.dicDeviceModelIdEnum["A418"].A类型名字;//调光模块
            }
            else if (info.BeloneType == DeviceBeloneType.A传感器
                || device.Type == DeviceType.TemperatureSensor)
                || device.Type == DeviceType.TemperatureSensor
                || device.Type == DeviceType.FreshAirHumiditySensor)
            {
                //传感器合并
                info.ConcreteType = DeviceConcreteType.Sensor;
@@ -2051,14 +2079,14 @@
                    //设置传感器具体的类型
                    info.BeloneType = DeviceBeloneType.A温湿度传感器;
                    info.ConcreteText = this.dicDeviceModelIdEnum["A411"].A官方名字;
                    info.ConcreteType = DeviceConcreteType.Sensor_TemperatureHumidity;
                    info.ConcreteType = DeviceConcreteType.Sensor_TemperatrueHumidity;
                }
                else if (temperatrue == true && humidity == false)
                {
                    //设置传感器具体的类型
                    info.BeloneType = DeviceBeloneType.A温度传感器;
                    info.ConcreteText = this.dicDeviceModelIdEnum["A412"].A官方名字;
                    info.ConcreteType = DeviceConcreteType.Sensor_Temperature;
                    info.ConcreteType = DeviceConcreteType.Sensor_Temperatrue;
                }
                else if (temperatrue == false && humidity == true)
                {
@@ -2707,15 +2735,14 @@
                                    listCheck.Add(mainkeys);
                                    //刷新一下本地缓存
                                    var localDevice = this.GetDevice(mainkeys);
                                    if (localDevice != null)
                                    var tempDevice = localDevice == null ? device : localDevice;
                                    //刷新属性
                                    this.SetDeviceInfoToMain(tempDevice, device);
                                    if (this.RefreshDeviceFunctionType(tempDevice, device, false) == true)
                                    {
                                        //刷新属性
                                        this.SetDeviceInfoToMain(localDevice, device);
                                        if (this.RefreshDeviceFunctionType(localDevice, device, false) == true)
                                        {
                                            //需要发送功能类型给网关
                                            listFucDevice.Add(localDevice);
                                        }
                                        //需要发送功能类型给网关
                                        listFucDevice.Add(tempDevice);
                                    }
                                }
                            }
@@ -3371,6 +3398,10 @@
        /// PM2.5空气质量传感器
        /// </summary>
        Sensor_PMTwoPointFive = 1307,
        /// <summary>
        /// 温湿度传感器
        /// </summary>
        Sensor_TemperatrueHumidity = 1308,
        /// <summary>
        /// 运动传感器
@@ -3381,13 +3412,9 @@
        /// </summary>
        Sensor_Keyfob = -1307,
        /// <summary>
        /// 温湿度传感器
        /// </summary>
        Sensor_TemperatureHumidity = -1308,
        /// <summary>
        /// 温度传感器
        /// </summary>
        Sensor_Temperature = -1309,
        Sensor_Temperatrue = -1309,
        /// <summary>
        /// 湿度传感器
        /// </summary>
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
Binary files differ
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
Binary files differ
ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -844,6 +844,8 @@
                var result = await HdlSceneLogic.Current.EditorSceneNameFromGateway(this.editorScene, this.cloneScene.Name);
                if (result == false)
                {
                    //关闭进度条
                    this.CloseProgressBar();
                    return;
                }
            }
@@ -851,10 +853,10 @@
            {
                //修改场景
                var result = await HdlSceneLogic.Current.EditorSceneFromGateway(this.editorScene, this.listAdjustTarget);
                //关闭进度条
                this.CloseProgressBar();
                if (result == false)
                {
                    //关闭进度条
                    this.CloseProgressBar();
                    return;
                }
            }
@@ -904,6 +906,9 @@
            //编辑场景,主页需要重新刷新
            UserView.UserPage.Instance.RefreshAllForm = true;
            //关闭进度条
            this.CloseProgressBar();
            HdlThreadLogic.Current.RunMain(() =>
            {
                //调用回调函数
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
@@ -47,6 +47,12 @@
                    //打开
                    this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
                    i_device.SwitchControl(1);
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //获取灯光亮度
                        System.Threading.Thread.Sleep(300);
                        HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
                    });
                }
                else
                {
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
@@ -47,6 +47,12 @@
                    //打开
                    this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
                    i_device.SwitchControl(1);
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //获取灯光亮度
                        System.Threading.Thread.Sleep(300);
                        HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
                    });
                }
                else
                {
ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
@@ -842,7 +842,7 @@
                            HomePage.Instance.ShowLoginLoadView();
                        });
                        var resultRegID = Shared.Common.CommonPage.Instance.PushRegID();
                        var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
                        var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                        //刷新个人中心的内存及线程
                        UserCenterLogic.InitUserCenterMenmoryAndThread();
                        //启动ZigBee
@@ -1111,7 +1111,7 @@
                Config.Instance.Save();
                var resultRegID = CommonPage.Instance.PushRegID();
                var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
                var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                //刷新个人中心的内存及线程
                UserCenterLogic.InitUserCenterMenmoryAndThread();
                //启动ZigBee
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
@@ -112,7 +112,7 @@
                            //绑定第三方
                            BindAuthUser(Config.Instance.Guid, OpenID);
                        }
                        var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
                        var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                        //刷新个人中心的内存及线程
                        UserCenterLogic.InitUserCenterMenmoryAndThread();
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
@@ -132,6 +132,7 @@
            seekBarColor.SeekBarPadding = Application.GetRealWidth(60);
            seekBarColor.IsProgressTextShow = true;
            seekBarColor.ProgressBarColor = UserCenterColor.Current.Transparent;
            seekBarColor.ProgressBarUnEnableColor = UserCenterColor.Current.Transparent;
            seekBarColor.SeekBarBackgroundColor = UserCenterColor.Current.Transparent;
            seekBarColor.ProgressTextSize = 14;
            seekBarColor.ProgressTextColor = UserCenterColor.Current.TextGrayColor2;
@@ -161,6 +162,7 @@
            this.btnBuzzerSwitch = new IconBigViewControl(81, 81);
            btnBuzzerSwitch.UnSelectedImagePath = "Item/Switch.png";
            btnBuzzerSwitch.SelectedImagePath = "Item/SwitchSelected.png";
            btnBuzzerSwitch.IsSelected = ((ColorTemperatureLight)this.device).IsBuzzerRing;
            frameWhiteBack.AddChidren(btnBuzzerSwitch);
            btnBuzzerSwitch.InitControl();
            btnBuzzerSwitch.UseClickStatu = false;
@@ -200,6 +202,12 @@
            };
            btnMiniSwitch.IsSelected = ((LightBase)this.device).OnOffStatus == 1;
            this.canSetProgressValue = btnMiniSwitch.IsSelected;
            if (btnMiniSwitch.IsSelected == false)
            {
                //在没有打开夜灯开关之前,不允许滑动
                seekBarLight.Enable = false;
                seekBarColor.Enable = false;
            }
            //亮度开始滑动的事件
            seekBarLight.OnStartTrackingTouchEvent += (sender, e) =>
@@ -347,7 +355,13 @@
                         {
                             //当是打开状态时,网关说它会默认把亮度变成100%
                             //以防万一,这里再次读取一下
                             ((ColorTemperatureLight)device).ReadLevel();
                             HdlThreadLogic.Current.RunThread(() =>
                             {
                                 ((ColorTemperatureLight)device).ReadLevel();
                                 System.Threading.Thread.Sleep(300);
                                 ((ColorTemperatureLight)device).ReadColorTemperature();
                             });
                         }
                     }
                 });
@@ -379,25 +393,19 @@
            //如果住宅是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                //((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
                ////刷新开关状态
                //this.RefreshSwitchStatu(isOpen);
                ((ColorTemperatureLight)this.device).IsBuzzerRing = isOpen;
                //刷新开关状态
                this.RefreshSwitchStatu(isOpen);
                return;
            }
            //检测是否获取网关反馈的结果,如果网关没有回复,则会弹出消息
            this.StartCheckResponeResult(new List<ButtonBase> { this.btnBuzzerSwitch.btnIcon }, (result) =>
            this.btnBuzzerSwitch.CanClick = false;
            this.StartCheckResponeResult(new List<ButtonBase>(), (result) =>
            {
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //接收到网关回复
                    if (result == true)
                    {
                        this.btnBuzzerSwitch.IsSelected = isOpen;
                        //bool statu = ((LightBase)this.device).OnOffStatus == 1;
                        ////刷新开关状态
                        //this.RefreshSwitchStatu(statu);
                    }
                    this.btnBuzzerSwitch.CanClick = true;
                });
            });
            //发送命令
@@ -463,11 +471,13 @@
        /// <param name="isOpen">打开状态</param>
        private void RefreshSwitchStatu(bool isOpen)
        {
            if (this.isColorProgressing == true)
            //刷新蜂鸣器开关状态
            bool isBuzzerRing = ((ColorTemperatureLight)this.device).IsBuzzerRing;
            if (this.btnBuzzerSwitch.IsSelected != isBuzzerRing)
            {
                //如果是色温滑动的话,不需要刷新界面
                return;
                this.btnBuzzerSwitch.IsSelected = isBuzzerRing;
            }
            if (isOpen == true)
            {
                //亮度是必须要刷新的  亮度 XX
@@ -482,13 +492,25 @@
                    //当进度值在手动变更中时,不接收推送
                    seekBarColor.Progress = (int)(((ColorTemperatureLight)this.device).ColorTemperature / 100);
                }
                this.btnMiniSwitch.IsSelected = true;
                if (this.btnMiniSwitch.IsSelected == false)
                {
                    this.btnMiniSwitch.IsSelected = true;
                }
                //滑动条可以滑动
                seekBarLight.Enable = true;
                seekBarColor.Enable = true;
            }
            else
            {
                //变更字样:关闭
                this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
                this.btnMiniSwitch.IsSelected = false;
                if (this.btnMiniSwitch.IsSelected == true)
                {
                    this.btnMiniSwitch.IsSelected = false;
                }
                //滑动条不可以滑动
                seekBarLight.Enable = false;
                seekBarColor.Enable = false;
            }
            //回复的结果说,处于打开状态才能发送
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
@@ -47,6 +47,12 @@
                    //打开
                    this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
                    i_device.SwitchControl(1);
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //获取灯光亮度
                        System.Threading.Thread.Sleep(300);
                        HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
                    });
                }
                else
                {
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
@@ -47,6 +47,12 @@
                    //打开
                    this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
                    i_device.SwitchControl(1);
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //获取灯光亮度
                        System.Threading.Thread.Sleep(300);
                        HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
                    });
                }
                else
                {
ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
@@ -544,8 +544,8 @@
            bodyFrameLayout.RemoveAll();
            bodyFrameLayout.Height = Application.GetRealHeight(750);
            this.listBodyContr.RecoverTableHeight();
            this.dicSceneCardControl.Clear();
            this.dicDeviceCardControl.Clear();
            this.dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
            this.dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
            var listDevice = new List<CommonDevice>();
            foreach (var mainkeys in HdlRoomLogic.Current.NowMainPageRoom.ListDevice)
@@ -804,8 +804,8 @@
            bodyFrameLayout.RemoveAll();
            bodyFrameLayout.Height = Application.GetRealHeight(750);
            this.listBodyContr.RecoverTableHeight();
            this.dicSceneCardControl.Clear();
            this.dicDeviceCardControl.Clear();
            this.dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
            this.dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
            var listScene = new List<SceneUI>();
            foreach (int sceneId in HdlRoomLogic.Current.NowMainPageRoom.ListSceneId)
@@ -1161,6 +1161,10 @@
        #endregion
        #region ■ 传感器状态还原_____________________
        #endregion
        #region ■ 切换楼层___________________________
        /// <summary>
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
@@ -11,7 +11,18 @@
    {
        #region ■ 变量声明___________________________
        private uint nowProgressBarColor = 0;
        /// <summary>
        /// 进度条可用时的背景色
        /// </summary>
        private uint ProgressBarEnableColor = 0;
        /// <summary>
        /// 进度条不可用时的背景色(默认灰色)
        /// </summary>
        public uint ProgressBarUnEnableColor = 0xffe8e8e8;
        /// <summary>
        /// 当前可用状态
        /// </summary>
        private bool nowEnable = true;
        /// <summary>
        /// 控件能否使用
        /// </summary>
@@ -19,16 +30,20 @@
        {
            set
            {
                //状态没有改变
                if (nowEnable == value) { return; }
                nowEnable = value;
                this.IsClickable = value;
                if (value == true)
                {
                    //原来的颜色
                    base.ProgressBarColor = nowProgressBarColor;
                    base.ProgressBarColor = ProgressBarEnableColor;
                }
                else
                {
                    //灰色
                    base.ProgressBarColor = 0xffe8e8e8;
                    base.ProgressBarColor = ProgressBarUnEnableColor;
                }
            }
        }
@@ -40,7 +55,7 @@
        {
            set
            {
                nowProgressBarColor = value;
                ProgressBarEnableColor = value;
                base.ProgressBarColor = value;
            }
        }
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
@@ -69,7 +69,7 @@
                var pra = new MessageInfoPra();
                pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotCheck" });
                var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotCheck" }, false);
                if (string.IsNullOrEmpty(result) == true)
                {
                    //出错,需要重新读取
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -375,7 +375,7 @@
        /// 发送获取灯光状态命令
        /// </summary>
        /// <param name="device">窗帘</param>
        private void SendLevelStatuComand(CommonDevice device)
        public void SendLevelStatuComand(CommonDevice device)
        {
            if (device == null)
            {
@@ -422,6 +422,12 @@
                colorDevice.ReadLevel();
                System.Threading.Thread.Sleep(300);
                colorDevice.ReadColorTemperature();
                if (LocalDevice.Current.IsMiniLight(device) == true)
                {
                    //mini夜灯需要读取蜂鸣器状态
                    System.Threading.Thread.Sleep(300);
                    colorDevice.ReadBuzzerStatu();
                }
            })
            { IsBackground = true }.Start();
        }
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
@@ -133,7 +133,7 @@
        private static int GetFirmwareVersionAndSetToMemmory(FirmwareLevelType levelType, GetFirmwareVersionPra pra)
        {
            var listCheck = new List<string> { "NotCheck" };
            string resultValue = UserCenterLogic.GetResponseDataByRequestHttps("FirmwareMana/DetectionPlatformUploadFirmware", false, pra, listCheck);
            string resultValue = UserCenterLogic.GetResponseDataByRequestHttps("FirmwareMana/DetectionPlatformUploadFirmware", false, pra, listCheck, false);
            if (string.IsNullOrEmpty(resultValue) == true)
            {
                return -1;
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -196,7 +196,7 @@
        /// </summary>
        /// <param name="zbGateway">网关</param>
        /// <param name="mode">是否显示错误</param>
        public async Task<bool> AddNewGateway(ZbGateway zbGateway, ShowErrorMode mode)
        public bool AddNewGateway(ZbGateway zbGateway, ShowErrorMode mode)
        {
            //设置网关的经纬度
            bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude, ShowErrorMode.NO);
@@ -205,7 +205,7 @@
                return falge;
            }
            //执行添加网关到内存
            var result = await this.DoAddGatewayToMemory(zbGateway, mode);
            var result = this.DoAddGatewayToMemory(zbGateway, mode);
            //前的网关绑定在了当前账号下的不同住宅里面
            if (result == 0)
            {
@@ -250,7 +250,7 @@
        /// <param name="zbGateway">网关对象</param>
        /// <param name="mode">是否显示错误</param>
        /// <returns></returns>
        private async Task<int> DoAddGatewayToMemory(ZbGateway zbGateway, ShowErrorMode mode)
        private int DoAddGatewayToMemory(ZbGateway zbGateway, ShowErrorMode mode)
        {
            if (zbGateway == null)
            {
@@ -278,7 +278,7 @@
            //设置住宅ID到网关
            if (result.HomeId != Common.Config.Instance.HomeId)
            {
                bool flage2 = await this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, mode);
                bool flage2 = this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, mode);
                if (flage2 == false)
                {
                    if (mode == ShowErrorMode.YES)
@@ -337,10 +337,28 @@
        /// <param name="zbGateway"></param>
        /// <param name="HomeId"></param>
        /// <returns></returns>
        public async Task<bool> SetHomeIdToGateway(ZbGateway zbGateway, string HomeId, ShowErrorMode mode)
        public bool SetHomeIdToGateway(ZbGateway zbGateway, string HomeId, ShowErrorMode mode)
        {
            ZbGateway realWay = null;
            if (this.GetRealGateway(ref realWay, zbGateway) == false)
            //账号ID
            string accountId = string.Empty;
            if (HomeId != string.Empty)
            {
                if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                {
                    //主账号
                    accountId = Config.Instance.Guid;
                }
                else
                {
                    accountId = Config.Instance.Home.MainUserDistributedMark;
                }
            }
            var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 82 } };
            var data = new Newtonsoft.Json.Linq.JObject { { "HomeId", HomeId }, { "AccountId", accountId } };
            jObject.Add("Data", data);
            //住宅ID的设置,固定使用局域网,不存在远程的说法
            var result = this.SendJobjectDataToGateway(zbGateway, "GwSetHomeId", jObject.ToString(), "GwSetHomeId_Respon", 5, true);
            if (result.ErrorMsgDiv == -1)
            {
                if (mode == ShowErrorMode.YES)
                {
@@ -350,13 +368,11 @@
                }
                return false;
            }
            var info = await realWay.GwSetHomeIdAsync(HomeId);
            if (info != null && info.gwSetHomeIdData != null)
            if (result.ErrorMsgDiv == 0)
            {
                return true;
                return false;
            }
            return false;
            return true;
        }
        /// <summary>
@@ -372,7 +388,7 @@
            //获取控制主人账号的Token
            bindGateway.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
            var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" });
            var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" }, false);
            if (result == "Error")
            {
                return -1;
@@ -418,7 +434,7 @@
        /// </summary>
        /// <param name="zbGateway">网关</param>
        /// <param name="btnMsg">消息控件</param>
        public async Task<int> ReBindNewGateway(ZbGateway zbGateway, NormalViewControl btnMsg = null)
        public int ReBindNewGateway(ZbGateway zbGateway, NormalViewControl btnMsg = null)
        {
            if (zbGateway == null)
            {
@@ -435,7 +451,7 @@
            }
            //设置住宅ID到网关
            bool flage2 = await this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, ShowErrorMode.YES);
            bool flage2 = this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, ShowErrorMode.YES);
            if (flage2 == false)
            {
                //向网关设置住宅ID失败
@@ -470,7 +486,7 @@
                    btnMsg.TextID = R.MyInternationalizationString.uGatewayDataIsChangingPleaseWhait;
                });
            }
            await Task.Delay(8000);
            System.Threading.Thread.Sleep(8000);
            //获取网关的信息
            ZbGatewayData.GetGwData result = null;
@@ -484,7 +500,7 @@
                }
                count--;
                //最多再等20秒
                await Task.Delay(4000);
                System.Threading.Thread.Sleep(4000);
            }
            if (result == null)
            {
@@ -579,12 +595,10 @@
        /// 执行切换网关操作
        /// </summary>
        /// <param name="gatewayId"></param>
        public async Task<bool> DoSwitchGateway(string gatewayId)
        public bool DoSwitchGateway(string gatewayId)
        {
            var zbGateway = this.GetLocalGateway(gatewayId);
            //重新获取在线网关的信息
            var result = await this.GetOnlineGatewayInfo(gatewayId);
            var result = this.GetOnlineGatewayInfo(gatewayId);
            if (result == false)
            {
                return false;
@@ -603,7 +617,7 @@
        /// </summary>
        /// <param name="gatewayId"></param>
        /// <returns></returns>
        private async Task<bool> GetOnlineGatewayInfo(string gatewayId)
        private bool GetOnlineGatewayInfo(string gatewayId)
        {
            //显示进度条
            ProgressBar.Show();
@@ -616,7 +630,7 @@
                //重新设置住宅ID(这个应该是不经过APP,直接把网关恢复了出厂设置)
                if (this.HomeIdIsEmpty(realWay.HomeId) == true)
                {
                    int result2 = await this.ReBindNewGateway(realWay);
                    int result2 = this.ReBindNewGateway(realWay);
                    if (result2 == 0)
                    {
                        //出现未知错误,请稍后再试
@@ -675,25 +689,15 @@
        /// <summary>
        /// 删除网关,包括云端和本地(失败时不会显示信息,并且会返回true)
        /// </summary>
        /// <param name="zbGateway"></param>
        public async Task<bool> DeleteGateway(ZbGateway zbGateway)
        {
            //移除本地网关信息
            return await this.DeleteGateway(zbGateway.GwId);
        }
        /// <summary>
        /// 删除网关,包括云端和本地(失败时不会显示信息,并且会返回true)
        /// </summary>
        /// <param name="zbGatewayID"></param>
        public async Task<bool> DeleteGateway(string zbGatewayID)
        public bool DeleteGateway(string zbGatewayID)
        {
            ZbGateway realWay = null;
            this.GetRealGateway(ref realWay, zbGatewayID);
            //清空网关的住宅ID 网关解绑失败  不理它,因为网关可以按按键强制搜索得到
            if (realWay != null)
            {
                await this.SetHomeIdToGateway(realWay, string.Empty, ShowErrorMode.NO);
                this.SetHomeIdToGateway(realWay, string.Empty, ShowErrorMode.NO);
            }
            //删除云端的网关
@@ -1487,24 +1491,39 @@
        #endregion
        #region ■ 清空真实网关列表___________________
        #region ■ 清空真实网关链接___________________
        /// <summary>
        /// 清空全部的真实物理网关对象
        /// 清空全部的真实物理网关的链接
        /// </summary>
        public void ClearAllRealGateway()
        /// <param name="roadGateway">是否加载本地的网关对象到真实列表中</param>
        public void ClearAllRealGatewayConection(bool roadGateway)
        {
            //因为那一瞬间,有可能mqtt会加回来,所以先加缓存
            var list = new List<ZbGateway>();
            list.AddRange(ZbGateway.GateWayList);
            //然后清空掉
            ZbGateway.GateWayList.Clear();
            //最后再断开mqtt连接
            for (int i = 0; i < list.Count; i++)
            //断开mqtt连接(即使保存在内存当中也没问题,因为如果广播不到,则它不会建立链接)
            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
            {
                list[i].DisConnectLocalMqttClient("G");
                ZbGateway.GateWayList[i].DisConnectLocalMqttClient("G");
            }
            list.Clear();
            //加载本地网关对象
            if (roadGateway == true)
            {
                List<string> listFile = this.GetAllGatewayFile();
                //反序列化添加到缓存
                foreach (string file in listFile)
                {
                    //从文件中反序列化出网关对象
                    var gateway = this.GetGatewayFromFile(file);
                    if (gateway == null)
                    {
                        continue;
                    }
                    var tempWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == gateway.GwId));
                    if (tempWay == null)
                    {
                        ZbGateway.GateWayList.Add(tempWay);
                    }
                }
            }
        }
        #endregion
@@ -1639,12 +1658,16 @@
        /// <returns></returns>
        public int IsMainGateway(string waiID)
        {
            ZbGateway zbGateway = null;
            if (this.GetRealGateway(ref zbGateway, waiID) == false)
            var realWay = ZbGateway.GateWayList.Find((obj) =>
            {
                return obj.GwId == waiID;
            });
            //虚拟网关也返回 0
            if (realWay == null || realWay.IsVirtual == true)
            {
                return 0;
            }
            return zbGateway.IsMainGateWay == true ? 1 : 2;
            return realWay.IsMainGateWay == true ? 1 : 2;
        }
        #endregion
@@ -1811,7 +1834,7 @@
                //获取控制主人账号的Token
                pra.ReqDto.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                var result = UserCenterLogic.GetResponseDataByRequestHttps("App/GetSingleHomeGatewayPagger", true, pra, list);
                var result = UserCenterLogic.GetResponseDataByRequestHttps("App/GetSingleHomeGatewayPagger", true, pra, list, false);
                if (string.IsNullOrEmpty(result) == true)
                {
                    canBreak = true;
@@ -1943,7 +1966,7 @@
            List<string> listNotShowError = new List<string>() { "NoExist", "NoBind", "NoRecord", "NotCheck" };
            bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/ReleaseGatewayToHome", true, Pra, listNotShowError);
            bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/ReleaseGatewayToHome", true, Pra, listNotShowError, false);
            if (result == false)
            {
                return false;
@@ -1996,7 +2019,7 @@
                {
                    bindGateway.BindGateways.Clear();
                    bindGateway.BindGateways.Add(gwId);
                    var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" });
                    var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" }, false);
                    if (result == "Success")
                    {
                        this.listBackupGwId.Remove(gwId);
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -277,6 +277,24 @@
                #endregion
                #region ■ 蜂鸣器推送
                //蜂鸣器数据
                else if (report.DeviceStatusReport.CluterID == 1282)
                {
                    //mini夜灯
                    if (Common.LocalDevice.Current.IsMiniLight(locadevice) == true)
                    {
                        foreach (var attData in report.DeviceStatusReport.AttriBute)
                        {
                            if (attData.AttributeId == 0)
                            {
                                ((ColorTemperatureLight)locadevice).IsBuzzerRing = attData.AttriButeData == 1 ? true : false;
                            }
                        }
                    }
                }
                #endregion
                #region ■ 窗帘数据
                //窗帘数据
                else if (report.DeviceStatusReport.CluterID == 258)
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
@@ -206,9 +206,11 @@
        /// <summary>
        /// 获取云端住宅列表
        /// </summary>
        public List<string> GetHomeListsFromDb()
        /// <param name="checkNetwork">是否检测网络,如果设置检测的话,当不能联网时,直接返回本地住宅</param>
        /// <returns></returns>
        public List<string> GetHomeListsFromDb(bool checkNetwork)
        {
            if (HdlWifiLogic.Current.CanAccessHttp == false)
            if (checkNetwork == true && HdlWifiLogic.Current.CanAccessHttp == false)
            {
                //当前无法联网
                return Config.Instance.HomeFilePathList;
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -1708,11 +1708,6 @@
            {
                return false;
            }
            if (zoneId > 3)
            {
                zoneId = 3;
            }
            //状态变更
            var result = await Safeguard.DisablePushMessageAsync(zoneId, statu);
            if (result == null || result.disablePushMessageResponseData == null || result.disablePushMessageResponseData.Result == 1)
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
@@ -411,11 +411,14 @@
                    }
                    //重新初始化Socket
                    ZigBee.Common.Application.FindGateWaySocket.Stop();
                    System.Threading.Thread.Sleep(100);
                    //断掉本地连接
                    HdlGatewayLogic.Current.ClearAllRealGateway();
                    HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                    //断掉远程
                    ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
                    //如果是wifi
                    if (value == 2)
                    {
                        ZigBee.Common.Application.FindGateWaySocket.Start();
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -22,15 +22,9 @@
        /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
        /// <param name="obj">一个类</param>
        /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
        /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
        public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
        /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
        public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
        {
            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
            {
                //当前无法访问网络(当需要重新发送时,跳过这个判断)
                ShowNotNetMsg(listNotShowError);
                return false;
            }
            //获取接口的连接模式
            var connectMode = GetHttpConnectMode(checkAuthority);
            //获取从接口那里取到的比特数据
@@ -39,7 +33,8 @@
            {
                if (setAgain == false)
                {
                    //不指定重发
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    return false;
                }
                byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -61,17 +56,10 @@
        /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
        /// <param name="obj">一个类</param>
        /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
        /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
        /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
        /// </param>
        public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
        public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
        {
            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
            {
                //当前无法访问网络(当需要重新发送时,跳过这个判断)
                ShowNotNetMsg(listNotShowError);
                return "Error";
            }
            //获取接口的连接模式
            var connectMode = GetHttpConnectMode(checkAuthority);
            //获取从接口那里取到的比特数据
@@ -80,7 +68,8 @@
            {
                if (setAgain == false)
                {
                    //不指定重发
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    return "Error";
                }
                byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -105,16 +94,10 @@
        /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
        /// <param name="obj">一个类</param>
        /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
        /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
        /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
        /// </param>
        public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
        public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
        {
            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
            {
                //当前无法访问网络(当需要重新发送时,跳过这个判断)
                ShowNotNetMsg(listNotShowError);
                return null;
            }
            //获取接口的连接模式
            var connectMode = GetHttpConnectMode(checkAuthority);
            //获取从接口那里取到的比特数据
@@ -123,7 +106,8 @@
            {
                if (setAgain == false)
                {
                    //不指定重发
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    return null;
                }
                byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -154,15 +138,9 @@
        /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
        /// <param name="obj">一个类</param>
        /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
        /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
        public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
        /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
        public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
        {
            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
            {
                //当前无法访问网络(当需要重新发送时,跳过这个判断)
                ShowNotNetMsg(listNotShowError);
                return null;
            }
            //获取接口的连接模式
            var connectMode = GetHttpConnectMode(checkAuthority);
            //获取从接口那里取到的比特数据
@@ -172,7 +150,8 @@
            {
                if (setAgain == false)
                {
                    //不指定重发
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    return null;
                }
                revertObj = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -537,7 +516,7 @@
            //断开远程Mqtt连接,重新连接
            HdlThreadLogic.Current.RunThread(async () =>
            {
                HdlGatewayLogic.Current.ClearAllRealGateway();
                HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
            }, ShowErrorMode.NO);
        }
@@ -618,7 +597,7 @@
                //清空当前住宅id
                Config.Instance.HomeId = string.Empty;
                HdlGatewayLogic.Current.ClearAllRealGateway();
                HdlGatewayLogic.Current.ClearAllRealGatewayConection(false);
                //断开远程Mqtt连接
                HdlThreadLogic.Current.RunThread(async () =>
@@ -674,8 +653,8 @@
                }
                else if (view is UserView.UserPage)
                {
                    var form = ((UserView.UserPage)view).GetNowActionForm();
                    form?.FormActionAgainEvent();
                    //刷新主页
                    UserView.UserPage.Instance.ReFreshControl();
                    return;
                }
                else
@@ -861,7 +840,7 @@
                //断开远程Mqtt连接,重新连接
                HdlThreadLogic.Current.RunThread(async () =>
                {
                    HdlGatewayLogic.Current.ClearAllRealGateway();
                    HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                    await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
                }, ShowErrorMode.NO);
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -269,7 +269,8 @@
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                //回路数大于1才展开
                if (Common.LocalDevice.Current.GetDevicesCountByMac(deviceMac) > 1)
                var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
                if (listMacDevice.Count > 1)
                {
                    btnRight.IsSelected = !btnRight.IsSelected;
                    //展开或者折叠明细列表
@@ -277,9 +278,20 @@
                }
                else
                {
                    if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
                    {
                        //mini夜灯的功能设置界面
                        var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
                        var form = new MainPage.DeviceDetailInfoForm();
                        form.AddForm(listMacDevice[0], room);
                    }
                    else
                    {
                        //设备信息界面
                        var form = new DeviceMacInfoEditorForm();
                        form.AddForm(deviceMac);
                    }
                    btnNew.Visible = false;
                    var form = new DeviceMacInfoEditorForm();
                    form.AddForm(deviceMac);
                    //界面跳转,记录当前的正在操作的设备的Mac地址
                    this.nowActionDeviceMac = deviceMac;
                }
@@ -296,9 +308,22 @@
                    form2.AddForm(deviceMac);
                    return;
                }
                var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
                if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
                {
                    //mini夜灯的功能设置界面
                    var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
                    var form = new MainPage.DeviceDetailInfoForm();
                    form.AddForm(listMacDevice[0], room);
                }
                else
                {
                    //设备信息界面
                    var form = new DeviceMacInfoEditorForm();
                    form.AddForm(deviceMac);
                }
                btnNew.Visible = false;
                var form = new DeviceMacInfoEditorForm();
                form.AddForm(deviceMac);
                //界面跳转,记录当前的正在操作的设备的Mac地址
                this.nowActionDeviceMac = deviceMac;
            };
@@ -674,7 +699,7 @@
        /// <summary>
        /// 滑动控件下拉刷新
        /// </summary>
        private async void ListViewBeginHeaderRefreshing()
        private void ListViewBeginHeaderRefreshing()
        {
            //如果当前住宅是虚拟的
            if (Common.Config.Instance.Home.IsVirtually == true)
@@ -701,7 +726,7 @@
                    {
                        //显示进度条
                        ProgressBar.Show();
                        int result2 = await HdlGatewayLogic.Current.ReBindNewGateway(realWay);
                        int result2 = HdlGatewayLogic.Current.ReBindNewGateway(realWay);
                        //关闭进度条
                        ProgressBar.Close();
                        if (result2 == -1)
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
@@ -239,7 +239,7 @@
            HdlThreadLogic.Current.RunThread(() =>
            {
                //清空全部列表
                HdlGatewayLogic.Current.ClearAllRealGateway();
                HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                ZigBee.Common.Application.IsSearchingGateway = true;
                int index = 1;
@@ -253,7 +253,7 @@
                    if (timeCount == 10)
                    {
                        //5秒后清空网关列表
                        HdlGatewayLogic.Current.ClearAllRealGateway();
                        HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                        ZigBee.Common.Application.IsSearchingGateway = true;
                    }
                    if (timeCount % 2 == 0)
@@ -316,7 +316,7 @@
        private void StartCheckGatewayThread()
        {
            this.isGatewaySearching = true;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                int count = 0;
                while (this.Parent != null && this.isGatewaySearching == true)
@@ -331,7 +331,7 @@
                    }
                    count = 0;
                    await this.CheckZbGatewayAndSetRow();
                    this.CheckZbGatewayAndSetRow();
                    if (this.newGatewayGetting == true)
                    {
@@ -345,7 +345,7 @@
        /// <summary>
        /// 检测搜索到的网关
        /// </summary>
        private async Task<bool> CheckZbGatewayAndSetRow()
        private bool CheckZbGatewayAndSetRow()
        {
            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
            {
@@ -383,7 +383,7 @@
                if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
                {
                    //添加搜索到的网关到缓存(执行网关保存操作)
                    var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    if (result == false)
                    {
                        continue;
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs
@@ -54,25 +54,35 @@
            rowWifi.InitControl();
            rowWifi.AddBottomLine();
            rowWifi.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
            //下拉图标是偏右的
            rowWifi.RightOffset = -Application.GetRealWidth(18);
            var btnDrop = rowWifi.AddMostRightEmptyIcon(58, 58);
            btnDrop.UnSelectedImagePath = "Item/Down.png";
            rowWifi.ChangedChidrenBindMode(btnDrop, ChidrenBindMode.NotBind);
            btnDrop.ButtonClickEvent += (sender, e) =>
            {
                //显示Wifi下拉列表
                this.ShowWifiListView(rowWifi);
            };
            //密码
            var btnPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
            btnPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
            frameBack.AddChidren(btnPsw);
            btnPsw.InitControl();
            btnPsw.txtInput.SecureTextEntry = true;
            btnPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
            var btnView = btnPsw.AddMostRightEmptyIcon(81, 81);
            var rowPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
            rowPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
            frameBack.AddChidren(rowPsw);
            rowPsw.InitControl();
            rowPsw.txtInput.SecureTextEntry = true;
            rowPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
            var btnView = rowPsw.AddMostRightEmptyIcon(81, 81);
            btnView.UnSelectedImagePath = "Item/HidenPWD.png";
            btnView.SelectedImagePath = "Item/UnHidenPWD.png";
            btnPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
            rowPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
            btnView.ButtonClickEvent += (sender, e) =>
            {
                btnView.IsSelected = !btnView.IsSelected;
                btnPsw.txtInput.SecureTextEntry = !btnPsw.txtInput.SecureTextEntry;
                rowPsw.txtInput.SecureTextEntry = !rowPsw.txtInput.SecureTextEntry;
            };
            var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false);
            var btnMsg = new NormalViewControl(rowPsw.txtInput.Width, false);
            btnMsg.X = ControlCommonResourse.XXLeft;
            btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
            btnMsg.TextSize = 12;
@@ -102,14 +112,14 @@
                    btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
                    return;
                }
                if (btnPsw.Text == string.Empty)
                if (rowPsw.Text == string.Empty)
                {
                    //请输入Wifi密码
                    btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
                    return;
                }
                //发送密码
                var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, btnPsw.Text);
                var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, rowPsw.Text);
                if (result == false)
                {
                    //密码发送失败
@@ -125,6 +135,60 @@
        #endregion
        #region ■ 显示Wifi下拉列表___________________
        /// <summary>
        /// 显示Wifi下拉列表
        /// </summary>
        /// <param name="rowWifi"></param>
        private void ShowWifiListView(FrameCaptionInputControl rowWifi)
        {
            //一个可以遮住Body的东西
            var frameTran = new NormalFrameLayout();
            frameTran.Height = bodyFrameLayout.Height;
            frameTran.BackgroundColor = UserCenterColor.Current.DialogBackColor;
            bodyFrameLayout.AddChidren(frameTran);
            frameTran.ButtonClickEvent += (sender, e) =>
            {
                frameTran.RemoveFromParent();
            };
            //白色背景框
            var frameList = new NormalFrameLayout();
            frameList.Y = rowWifi.Bottom;
            frameList.Gravity = Gravity.CenterHorizontal;
            frameList.Width = frameTran.Width - ControlCommonResourse.XXLeft * 2;
            frameList.Height = this.GetPictrueRealSize(1200);
            frameList.Radius = (uint)Application.GetRealWidth(17);
            frameList.BackgroundColor = UserCenterColor.Current.White;
            frameTran.AddChidren(frameList);
            //列表控件
            var listView = new VerticalListControl();
            listView.Height = frameList.Height;
            frameList.AddChidren(listView);
            for (int i = 1; i <= 10; i++)
            {
                var frameRow = new FrameRowControl();
                listView.AddChidren(frameRow);
                //wifi名字
                var btnWifi = new NormalViewControl(frameRow.Width, frameRow.Height - ControlCommonResourse.BottomLineHeight, false);
                btnWifi.X = ControlCommonResourse.XXLeft;
                btnWifi.Text = "Application Software" + i;
                frameRow.AddChidren(btnWifi, ChidrenBindMode.BindEvent);
                //底线
                var btnLine = new NormalViewControl(frameRow.Width, ControlCommonResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
                btnLine.Y = btnWifi.Bottom;
                frameRow.AddChidren(btnLine, ChidrenBindMode.BindEvent);
                frameRow.ButtonClickEvent += (sender, e) =>
                {
                    rowWifi.Text = btnWifi.Text;
                    frameTran.RemoveFromParent();
                };
            }
        }
        #endregion
        #region ■ 界面关闭___________________________
        /// <summary>
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
@@ -292,10 +292,10 @@
        private void StartCheckGatewayThread()
        {
            this.isGatewaySearching = true;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //清空全部列表
                HdlGatewayLogic.Current.ClearAllRealGateway();
                HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                ZigBee.Common.Application.IsSearchingGateway = true;
                int count = 0;
@@ -311,7 +311,7 @@
                    }
                    count = 0;
                    await this.CheckZbGatewayAndSetRow();
                    this.CheckZbGatewayAndSetRow();
                    if (this.newGatewayGetting == true)
                    {
@@ -325,7 +325,7 @@
        /// <summary>
        /// 检测搜索到的网关,然后添加到画面的行里面
        /// </summary>
        private async Task<bool> CheckZbGatewayAndSetRow()
        private bool CheckZbGatewayAndSetRow()
        {
            List<string> listId = new List<string>();
            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
@@ -389,7 +389,7 @@
                if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
                {
                    //添加搜索到的网关到缓存(执行网关保存操作)
                    var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    if (result == false)
                    {
                        continue;
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
@@ -249,7 +249,7 @@
                    if (timeCount == 10)
                    {
                        //5秒后清空网关列表
                        HdlGatewayLogic.Current.ClearAllRealGateway();
                        HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                        ZigBee.Common.Application.IsSearchingGateway = true;
                    }
                    if (timeCount % 2 == 0)
@@ -312,7 +312,7 @@
        private void StartCheckGatewayThread()
        {
            this.isGatewaySearching = true;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                int count = 0;
                while (this.Parent != null && this.isGatewaySearching == true)
@@ -327,7 +327,7 @@
                    }
                    count = 0;
                    await this.CheckZbGatewayAndSetRow();
                    this.CheckZbGatewayAndSetRow();
                    if (this.newGatewayGetting == true)
                    {
@@ -341,7 +341,7 @@
        /// <summary>
        /// 检测搜索到的网关
        /// </summary>
        private async Task<bool> CheckZbGatewayAndSetRow()
        private bool CheckZbGatewayAndSetRow()
        {
            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
            {
@@ -379,7 +379,7 @@
                if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
                {
                    //添加搜索到的网关到缓存(执行网关保存操作)
                    var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    if (result == false)
                    {
                        continue;
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
namespace Shared.Phone.UserCenter.GatewayAdd
@@ -52,25 +51,35 @@
            rowWifi.InitControl();
            rowWifi.AddBottomLine();
            rowWifi.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
            //下拉图标是偏右的
            rowWifi.RightOffset = -Application.GetRealWidth(18);
            var btnDrop = rowWifi.AddMostRightEmptyIcon(58, 58);
            btnDrop.UnSelectedImagePath = "Item/Down.png";
            rowWifi.ChangedChidrenBindMode(btnDrop, ChidrenBindMode.NotBind);
            btnDrop.ButtonClickEvent += (sender, e) =>
            {
                //显示Wifi下拉列表
                this.ShowWifiListView(rowWifi);
            };
            //密码
            var btnPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
            btnPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
            frameBack.AddChidren(btnPsw);
            btnPsw.InitControl();
            btnPsw.txtInput.SecureTextEntry = true;
            btnPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
            var btnView = btnPsw.AddMostRightEmptyIcon(81, 81);
            var rowPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
            rowPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
            frameBack.AddChidren(rowPsw);
            rowPsw.InitControl();
            rowPsw.txtInput.SecureTextEntry = true;
            rowPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
            var btnView = rowPsw.AddMostRightEmptyIcon(81, 81);
            btnView.UnSelectedImagePath = "Item/HidenPWD.png";
            btnView.SelectedImagePath = "Item/UnHidenPWD.png";
            btnPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
            rowPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
            btnView.ButtonClickEvent += (sender, e) =>
            {
                btnView.IsSelected = !btnView.IsSelected;
                btnPsw.txtInput.SecureTextEntry = !btnPsw.txtInput.SecureTextEntry;
                rowPsw.txtInput.SecureTextEntry = !rowPsw.txtInput.SecureTextEntry;
            };
            var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false);
            var btnMsg = new NormalViewControl(rowPsw.txtInput.Width, false);
            btnMsg.X = ControlCommonResourse.XXLeft;
            btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
            btnMsg.TextSize = 12;
@@ -100,14 +109,14 @@
                    btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
                    return;
                }
                if (btnPsw.Text == string.Empty)
                if (rowPsw.Text == string.Empty)
                {
                    //请输入Wifi密码
                    btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
                    return;
                }
                //发送密码
                var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, btnPsw.Text);
                var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, rowPsw.Text);
                if (result == false)
                {
                    //密码发送失败
@@ -115,13 +124,68 @@
                    return;
                }
                var form = new WirelessApDirection3Form();
                this.AddFromAndRemoveNowForm(form);
                this.CloseForm();
                var form = new MiniGatewayDirection3Form();
                form.AddForm();
            };
        }
        #endregion
        #region ■ 显示Wifi下拉列表___________________
        /// <summary>
        /// 显示Wifi下拉列表
        /// </summary>
        /// <param name="rowWifi"></param>
        private void ShowWifiListView(FrameCaptionInputControl rowWifi)
        {
            //一个可以遮住Body的东西
            var frameTran = new NormalFrameLayout();
            frameTran.Height = bodyFrameLayout.Height;
            frameTran.BackgroundColor = UserCenterColor.Current.DialogBackColor;
            bodyFrameLayout.AddChidren(frameTran);
            frameTran.ButtonClickEvent += (sender, e) =>
            {
                frameTran.RemoveFromParent();
            };
            //白色背景框
            var frameList = new NormalFrameLayout();
            frameList.Y = rowWifi.Bottom;
            frameList.Gravity = Gravity.CenterHorizontal;
            frameList.Width = frameTran.Width - ControlCommonResourse.XXLeft * 2;
            frameList.Height = this.GetPictrueRealSize(1200);
            frameList.Radius = (uint)Application.GetRealWidth(17);
            frameList.BackgroundColor = UserCenterColor.Current.White;
            frameTran.AddChidren(frameList);
            //列表控件
            var listView = new VerticalListControl();
            listView.Height = frameList.Height;
            frameList.AddChidren(listView);
            for (int i = 1; i <= 10; i++)
            {
                var frameRow = new FrameRowControl();
                listView.AddChidren(frameRow);
                //wifi名字
                var btnWifi = new NormalViewControl(frameRow.Width, frameRow.Height - ControlCommonResourse.BottomLineHeight, false);
                btnWifi.X = ControlCommonResourse.XXLeft;
                btnWifi.Text = "Application Software" + i;
                frameRow.AddChidren(btnWifi, ChidrenBindMode.BindEvent);
                //底线
                var btnLine = new NormalViewControl(frameRow.Width, ControlCommonResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
                btnLine.Y = btnWifi.Bottom;
                frameRow.AddChidren(btnLine, ChidrenBindMode.BindEvent);
                frameRow.ButtonClickEvent += (sender, e) =>
                {
                    rowWifi.Text = btnWifi.Text;
                    frameTran.RemoveFromParent();
                };
            }
        }
        #endregion
        #region ■ 界面关闭___________________________
        /// <summary>
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
@@ -249,7 +249,7 @@
                    if (timeCount == 10)
                    {
                        //5秒后清空网关列表
                        HdlGatewayLogic.Current.ClearAllRealGateway();
                        HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                        ZigBee.Common.Application.IsSearchingGateway = true;
                    }
                    if (timeCount % 2 == 0)
@@ -312,7 +312,7 @@
        private void StartCheckGatewayThread()
        {
            this.isGatewaySearching = true;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                int count = 0;
                while (this.Parent != null && this.isGatewaySearching == true)
@@ -327,7 +327,7 @@
                    }
                    count = 0;
                    await this.CheckZbGatewayAndSetRow();
                    this.CheckZbGatewayAndSetRow();
                    if (this.newGatewayGetting == true)
                    {
@@ -341,7 +341,7 @@
        /// <summary>
        /// 检测搜索到的网关
        /// </summary>
        private async Task<bool> CheckZbGatewayAndSetRow()
        private bool CheckZbGatewayAndSetRow()
        {
            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
            {
@@ -379,7 +379,7 @@
                if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
                {
                    //添加搜索到的网关到缓存(执行网关保存操作)
                    var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    if (result == false)
                    {
                        continue;
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -330,7 +330,7 @@
        private void CheckNewVersion(PicViewControl btnNewVersion)
        {
            //获取网关版本信息
            var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
            var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway, ShowErrorMode.NO);
            if (result == null)
            {
                return;
@@ -380,9 +380,9 @@
        /// </summary>
        /// <param name="gatewayId"></param>
        /// <param name="online"></param>
        private async void DoSwitchGateway()
        private void DoSwitchGateway()
        {
            var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
            var result = HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
            if (result == false)
            {
                return;
@@ -425,13 +425,13 @@
        /// <param name="row"></param>
        private void DeleteGateway(string strWayId)
        {
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //打开进度条
                this.ShowProgressBar();
                //删除云端网关
                bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
                bool result = HdlGatewayLogic.Current.DeleteGateway(strWayId);
                //关闭进度条
                this.CloseProgressBar();
                if (result == false)
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -238,12 +238,12 @@
        /// </summary>
        /// <param name="strWayId"></param>
        /// <param name="row"></param>
        private async void DeleteGateway(string strWayId)
        private void DeleteGateway(string strWayId)
        {
            //打开进度条
            this.ShowProgressBar();
            //删除云端网关
            bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
            bool result = HdlGatewayLogic.Current.DeleteGateway(strWayId);
            //关闭进度条
            this.CloseProgressBar();
            if (result == false)
@@ -273,9 +273,9 @@
        /// </summary>
        /// <param name="gatewayId"></param>
        /// <param name="online"></param>
        private async void DoSwitchGateway(string gatewayId)
        private void DoSwitchGateway(string gatewayId)
        {
            var result = await HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
            var result = HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
            if (result == false)
            {
                return;
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
@@ -40,14 +40,21 @@
            btnMsg.TextID = R.MyInternationalizationString.uIsReBindingPleaseWaiting;
            bodyFrameLayout.AddChidren(btnMsg);
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                await System.Threading.Tasks.Task.Delay(1000);
                int value = await HdlGatewayLogic.Current.ReBindNewGateway(i_gateway, btnMsg);
                System.Threading.Thread.Sleep(1000);
                int value = HdlGatewayLogic.Current.ReBindNewGateway(i_gateway, btnMsg);
                if (value == 1)
                {
                    //成功
                    i_dicZbGatewayDiv[i_gateway.GwId] = 1;
                    //我觉得这里需要获取一下新网关的设备列表
                    Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(i_gateway, true);
                    if (i_gateway.IsMainGateWay == true)
                    {
                        //如果它是主网关,则刷新场景列表
                        HdlSceneLogic.Current.RefreshSceneUIList(true);
                    }
                }
                else if (value == 0)
                {
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
@@ -178,12 +178,9 @@
        /// </summary>
        public override void CloseFormBefore()
        {
            var userPageForm = UserView.UserPage.Instance.GetNowActionForm();
            if (userPageForm != null && userPageForm.FormID == "UserMainForm")
            {
                //刷新主页
                UserView.UserPage.Instance.ReFreshControl();
            }
            //刷新主页
            UserView.UserPage.Instance.ReFreshControl();
            base.CloseFormBefore();
        }
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
@@ -63,7 +63,7 @@
            row1.AddBottomLine();
            row1.ButtonClickEvent += (sender, e) =>
            {
                var form = new HideOptionFileListForm();
                var form = new HideOptionSearchAllFile();
                form.AddForm(Common.Config.Instance.FullPath);
            };
@@ -99,7 +99,7 @@
            row1.ButtonClickEvent += (sender, e) =>
            {
                var form = new HideOptionFileListForm();
                var form = new HideOptionSearchAllFile();
                form.AddForm(directoryValue);
            };
        }
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs
File was deleted
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
@@ -69,13 +69,13 @@
            this.AddNormalRowControl("手机获取的IP", 600, new Shared.Net.NetWiFi().BroadcastIpAddress.ToString(), 600);
            if (ZigBee.Common.Application.FindGateWaySocket.busSocket == null)
            if (ZigBee.Common.Application.FindGateWaySocket.udpClient == null)
            {
                this.AddNormalRowControl("Socket链接", 400, "未初始化", 400);
            }
            else
            {
                this.AddNormalRowControl("Socket链接", 400, ZigBee.Common.Application.FindGateWaySocket.busSocket.Connected == true ? "true" : "false", 400);
                this.AddNormalRowControl("Socket链接", 400, "已初始化", 400);
            }
            int count = ZbGateway.GateWayList.Count;
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs
@@ -131,6 +131,30 @@
                }
            }
            listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(50));
            var btnButon = new BottomClickButton();
            btnButon.Text = "删除文件夹";
            bodyFrameLayout.AddChidren(btnButon);
            btnButon.ButtonClickEvent += (sender, e) =>
            {
                this.ShowMassage(ShowMsgType.Confirm, "是否清除该文件夹", () =>
                {
                    try
                    {
                        System.IO.Directory.Delete(directory, true);
                        this.CloseForm();
                    }
                    catch (Exception ex)
                    {
                        this.ShowMassage(ShowMsgType.Error, "清除缓存文件夹异常");
                        HdlLogLogic.Current.WriteLog(ex, "清除缓存文件夹异常");
                    }
                });
            };
            if (directory == Common.Config.Instance.FullPath)
            {
                btnButon.CanClick = false;
            }
        }
        private void AddDirectoryRowControl(VerticalListControl listView, string directoryName, string directory, bool addLine)
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
@@ -358,7 +358,7 @@
                        return;
                    }
                    pra.Account = dicMemberAccount[keys];
                    var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" });
                    var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" }, false);
                    if (result == null)
                    {
                        continue;
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
@@ -416,7 +416,7 @@
            {
                var pra = new AccountInfoPra();
                pra.Account = memberInfo.Account;
                var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" });
                var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" }, false);
                if (result == null)
                {
                    return;
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
@@ -124,7 +124,7 @@
        {
            //获取住宅信息
            var Pra = new GetResidenceInfoPra();
            string resultData = UserCenterLogic.GetResponseDataByRequestHttps("App/GetHomePager", false, Pra, new List<string> { "NotCheck" });
            string resultData = UserCenterLogic.GetResponseDataByRequestHttps("App/GetHomePager", false, Pra, new List<string> { "NotCheck" }, false);
            if (string.IsNullOrEmpty(resultData) == true)
            {
                return false;
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -693,6 +693,7 @@
            var myHouse = HdlResidenceLogic.Current.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
            //切换住宅
            Common.Config.Instance.HomeId = myHouse.Id;
            Common.Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(myHouse.Id);
            Common.Global.CreateHomeDirectory(myHouse.Id);
            Common.Config.Instance.Save();
ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -64,7 +64,7 @@
                    //登录成功,或者没有网络都可以登录
                    if (loginSuccess == 1 || loginSuccess == 2)
                    {
                        var homes = UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb();
                        var homes = UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb(true);
                        //刷新个人中心的内存及线程
                        UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
                        //启动ZigBee
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -160,13 +160,13 @@
                {
                    try
                    {
                        if (FindGateWaySocket.busSocket == null || FindGateWaySocket.busSocket.Available <= 0)
                        if (FindGateWaySocket.udpClient == null || FindGateWaySocket.udpClient.Available <= 0)
                        {
                            System.Threading.Thread.Sleep(500);
                            continue;
                        }
                        var bytes = new byte[1024];
                        var len = FindGateWaySocket.busSocket.Receive(bytes, bytes.Length, System.Net.Sockets.SocketFlags.None);
                        }
                        var ipEndPoint = new System.Net.IPEndPoint(0, 0);
                        var bytes = FindGateWaySocket.udpClient.Receive(ref ipEndPoint);
                        if (bytes[43] == 0xA2)
                        {
                            //广播回复网关的基本信息处理
@@ -284,7 +284,14 @@
                            }
                        }
                    }
                    catch { }
                    catch (Exception ex)
                    {
                        //调试用
                        if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.WriteSocketReceiveDataToFile == 1)
                        {
                            Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(3, "Receive异常\r\n" + ex.Message);
                        }
                    }
                }
            })
            { IsBackground = true }.Start();
@@ -390,24 +397,19 @@
        public static class FindGateWaySocket
        {
            //本地Socket
            public static Socket busSocket;
            public static UdpClient udpClient;
            /// <summary>
            /// 启动Socket接收和发送功能
            /// </summary>
            /// <param name="port"></param>
            public static void Start(int port = 7624)
            public static void Start()
            {
                if (IsRunning)
                if (udpClient!=null)
                {
                    return;
                }
                //定义网络类型,数据连接类型和网络协议UDP
                busSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                busSocket.EnableBroadcast = true;
                busSocket.ReceiveTimeout = 1000;
                busSocket.SendTimeout = 1000;
                busSocket.Bind(new IPEndPoint(IPAddress.Any, port));
                udpClient = new UdpClient { EnableBroadcast = true };
            }
            /// <summary>
@@ -417,23 +419,12 @@
            {
                try
                {
                    busSocket?.Close();
                    udpClient?.Close();
                }
                catch { }
                busSocket = null;
                udpClient = null;
                Console.WriteLine("BusSocket关闭成功!");
            }
            /// <summary>
            /// 当前的Socket是否运行
            /// </summary>
            public static bool IsRunning
            {
                get
                {
                    return busSocket == null ? false : true;
                }
            }
            /// <summary>
@@ -444,11 +435,11 @@
            {
                try
                {
                    if (IsRunning)
                    if (udpClient == null)
                    {
                        busSocket.BeginSendTo(bytes, 0, bytes.Length, SocketFlags.None, iPEndPoint, new AsyncCallback(asyncEndSend), null);
                        return;
                    }
                    udpClient.Send(bytes, bytes.Length, iPEndPoint);
                }
                catch (Exception ex)
                {
@@ -459,28 +450,8 @@
                    }
                }
            }
            /// <summary>
            /// 异步发送数据结束
            /// </summary>
            /// <param name="iar"></param>
            private static void asyncEndSend(IAsyncResult iar)
            {
                try
                {
                    int bytesSent = busSocket.EndSendTo(iar);
                }
                catch (Exception ex)
                {
                    //调试用
                    if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.WriteSocketReceiveDataToFile == 1)
                    {
                        Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(3, "异步发送结束异常(asyncEndSend)\r\n" + ex.Message);
                    }
                }
            }
        }
        #endregion
    }
}
}
ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs
@@ -28,6 +28,12 @@
        public int ColorTemperature = 0;
        /// <summary>
        ///蜂鸣器是否在响着(true:响着 false:不响)
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public bool IsBuzzerRing = false;
        /// <summary>
        /// 读取亮度
        /// </summary>
        public void ReadLevel()
@@ -43,6 +49,14 @@
            ReadAttri(Device.Cluster_ID.ColorControl, AttriButeId.LevelControl);
        }
        /// <summary>
        /// 读取蜂鸣器状态(小夜灯专用)
        /// </summary>
        public void ReadBuzzerStatu()
        {
            ReadAttri((Cluster_ID)1282, 0);
        }
        ///<summary >
        ///设置设备亮度(Level)
        ///<para>value:亮度值取值范围:0-254</para>
ZigbeeApp/Shared/Shared.projitems
@@ -291,7 +291,6 @@
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HdlBackup\HdlBackupListForm.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionDirectoryListForm.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileContentForm.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileListForm.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionGatewayListForm.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMainForm.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMemoryListDeviceForm.cs" />