黄学彪
2020-01-09 fa6bcb2e9907772480f99205f36ec2a1ce735a22
合并代码
10个文件已删除
75个文件已修改
20248 ■■■■ 已修改文件
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/project-cache/DroidLib-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/project-cache/GateWay.Droid-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/project-cache/GateWay.Ios-Debug|iPhoneSimulator.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/project-cache/ShardLib-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/project-cache/Shared.Droid-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/project-cache/Shared.IOS-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/sqlite3/db.lock 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Assets/Language.ini 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs 16240 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Home.Ios/Resources/Language.ini 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/CommonPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/ComparerDeviceUI.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/Device.cs 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/DeviceUI.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/Room.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/ZigbeeColor.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Category/Category.cs 292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneRow.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs 302 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs 256 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetySensorStatuControl.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlACZbGatewayUpdateLogic.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs 636 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserView/SafetyShortcutControl.cs 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs 629 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/R.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Shared.projitems 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
File was deleted
ZigbeeApp/.vs/GateWay/xs/project-cache/DroidLib-Debug.json
File was deleted
ZigbeeApp/.vs/GateWay/xs/project-cache/GateWay.Droid-Debug.json
File was deleted
ZigbeeApp/.vs/GateWay/xs/project-cache/GateWay.Ios-Debug|iPhoneSimulator.json
File was deleted
ZigbeeApp/.vs/GateWay/xs/project-cache/ShardLib-Debug.json
File was deleted
ZigbeeApp/.vs/GateWay/xs/project-cache/Shared.Droid-Debug.json
File was deleted
ZigbeeApp/.vs/GateWay/xs/project-cache/Shared.IOS-Debug.json
File was deleted
ZigbeeApp/.vs/GateWay/xs/sqlite3/db.lock
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -707,7 +707,7 @@
11010=没有功能 {\r\n} 请在个人中心--设备管理处添加
11011=编辑
11012=设置功能
11012=功能设置
11013=信息编辑
11014=功能名称
11015=所属区域
@@ -732,7 +732,7 @@
11034=确定要移除该功能?
11035=添加功能
11036=添加延时
11037=空调模式为空,请先配置
12100=未知设备
@@ -1817,6 +1817,9 @@
16058=我的家
16059=长按“我的家”{0}可切换我的住宅
16060=办公室
16061=电机数据异常,请重置电机
16062=获取空调摆风状态失败
16063=设置空调摆风失败
;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
18004=指定网关已经被绑定
ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
old mode 100644 new mode 100755
@@ -40,6 +40,10 @@
    <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
    <AndroidSupportedAbis />
    <AndroidDexTool>d8</AndroidDexTool>
    <AotAssemblies>false</AotAssemblies>
    <EnableLLVM>false</EnableLLVM>
    <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
    <BundleAssemblies>false</BundleAssemblies>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
@@ -53,6 +57,10 @@
    <MandroidI18n>cjk</MandroidI18n>
    <DefineConstants>Android,Release</DefineConstants>
    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
    <AotAssemblies>false</AotAssemblies>
    <EnableLLVM>false</EnableLLVM>
    <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
    <BundleAssemblies>false</BundleAssemblies>
    <AndroidDexTool>d8</AndroidDexTool>
    <AndroidUseAapt2>false</AndroidUseAapt2>
  </PropertyGroup>
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
old mode 100644 new mode 100755
@@ -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="2020010601" android:installLocation="auto" android:versionName="1.0.20010601">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020010701" android:installLocation="auto" android:versionName="1.0.20010701">
    <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" />
@@ -164,7 +164,7 @@
        <meta-data android:name="JPUSH_APPKEY" android:value="f4a3322fbc45e58d04c85191" />
        <!--  </>值来自开发者平台取得的AppKey-->
        <!-- 极光推送结束 -->
        <!-- 设置高德地图key -->
        <meta-data android:name="com.amap.api.v2.apikey" android:value="1f753413955012c9594c5df69eaa0aff" />
    <!-- 设置高德地图key -->
    <meta-data android:name="com.amap.api.v2.apikey" android:value="1f753413955012c9594c5df69eaa0aff" />
    </application>
</manifest>
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
old mode 100644 new mode 100755
Diff too large
ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -707,7 +707,7 @@
11010=没有功能 {\r\n} 请在个人中心--设备管理处添加
11011=编辑
11012=设置功能
11012=功能设置
11013=信息编辑
11014=功能名称
11015=所属区域
@@ -732,7 +732,7 @@
11034=确定要移除该功能?
11035=添加功能
11036=添加延时
11037=空调模式为空,请先配置
12100=未知设备
@@ -1817,6 +1817,9 @@
16058=我的家
16059=长按“我的家”{0}可切换我的住宅
16060=办公室
16061=电机数据异常,请重置电机
16062=获取空调摆风状态失败
16063=设置空调摆风失败
;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
18004=指定网关已经被绑定
ZigbeeApp/Shared/Common/CommonPage.cs
@@ -62,7 +62,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string CodeIDString = "1.0.20010601";
        public static string CodeIDString = "1.0.20010701";
        /// <summary>
        /// 注册来源(0:HDL On 1:Zigbee)
        /// </summary>
ZigbeeApp/Shared/Common/ComparerDeviceUI.cs
File was deleted
ZigbeeApp/Shared/Common/Device.cs
@@ -223,20 +223,19 @@
        #region ■ 添加设备___________________________
        /// <summary>
        /// 将指定网关的设备存入缓存中(从新获取镜像)
        /// <para>将指定网关的设备存入缓存中(从新获取镜像)</para>
        /// <para>-1:异常 1:正常 2:设备信息缺损</para>
        /// </summary>
        /// <param name="zbGateway">网关对象</param>
        /// <param name="deviceComingAction">接收到设备时的事件,设备对象为null时,代表接收完成</param>
        /// <returns>一直返回true</returns>
        public bool SetDeviceToMemmoryByGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null)
        public int SetDeviceToMemmoryByGateway(ZbGateway zbGateway)
        {
            //从网关获取全部的设备
            int statu = 0;
            List<CommonDevice> listDevice = new List<CommonDevice>();
            List<CommonDevice> list = this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction);
            List<CommonDevice> list = this.GetDeviceListFromGateway(zbGateway, ref statu, true);
            if (list == null)
            {
                return false;
                return -1;
            }
            listDevice.AddRange(list);
@@ -301,14 +300,17 @@
                }
            }
            //如果本地和网关的设备不一致的时候,暂时删除本地的设备
            //注意:只是删除设备文件,房间内容什么的还存在着
            foreach (var device in dicExist.Values)
            //只有完全获取的时候,才会去处理删除的问题
            if (statu == 1)
            {
                this.DeleteMemmoryDevice(device, false);
                //如果本地和网关的设备不一致的时候,删除本地的设备
                foreach (var device in dicExist.Values)
                {
                    this.DeleteMemmoryDevice(device, true);
                }
            }
            return true;
            return statu;
        }
        /// <summary>
@@ -1157,13 +1159,18 @@
            {
                //不存在则使用共通图片
                string[] arry = strSpecific.Split(new string[] { "_" }, StringSplitOptions.None);
                if (arry.Length == 1)
                //如果它自己就是共通图片的话,不再处理
                if (arry.Length > 1)
                {
                    //如果它自己就是共通图片的话,不再处理
                    return;
                    imageFilePath = "Device/" + arry[0] + ".png";
                    imageSelectFilePath = "Device/" + arry[0] + "Selected.png";
                }
                imageFilePath = "Device/" + arry[0] + ".png";
                imageSelectFilePath = "Device/" + arry[0] + "Selected.png";
            }
            //如果那款设备连共通图片都没有的话
            if (string.IsNullOrEmpty(IO.FileUtils.GetImageFilePath(imageFilePath)) == true)
            {
                imageFilePath = "Device/ThirdPartyDevice.png";
                imageSelectFilePath = "Device/ThirdPartyDeviceSelected.png";
            }
            //设置图片
            unSelectPath = imageFilePath;
@@ -1817,36 +1824,23 @@
        #region ■ 获取设备列表的接口_________________
        /// <summary>
        /// 从网关重新获取设备列表(★★★★★★★接收到设备时的事件★★★★★★★)
        /// <para>从网关重新获取设备列表(返回的设备为虚拟出来的)</para>
        /// <para>statu状态 -1:异常,会返回null, 1:没有异常, 2:数据接收不全</para>
        /// </summary>
        /// <param name="zbGateway">网关对象</param>
        /// <param name="ignoreTime">是否无视时间,true:每次调用都去网关获取,false:3分钟内返回的是本地的设备</param>
        /// <param name="deviceComingAction">接收到设备时的事件</param>
        /// <param name="statu">状态-> -1:异常,会返回null, 1:没有异常, 2:数据接收不全</param>
        /// <param name="ignoreTime">是否无视时间(此变量是给获取在线状态用的),true:每次调用都去网关获取,false:3分钟内返回的是本地的设备</param>
        /// <param name="mode">是否显示错误</param>
        /// <returns></returns>
        public List<CommonDevice> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES)
        public List<CommonDevice> GetDeviceListFromGateway(ZbGateway zbGateway, ref int statu, bool ignoreTime, ShowErrorMode mode = ShowErrorMode.YES)
        {
            if (ignoreTime == false)
            {
                if ((DateTime.Now - zbGateway.LastDateTime).TotalMilliseconds < 3 * 60 * 1000)
                {
                    //不无视时间,返回本地设备列表
                    var listTemp = this.GetDeviceByGatewayID(HdlGatewayLogic.Current.GetGatewayId(zbGateway));
                    if (deviceComingAction != null)
                    {
                        for (int i = 0; i < listTemp.Count; i++)
                        {
                            try
                            {
                                //回调函数
                                deviceComingAction.Invoke(listTemp[i]);
                            }
                            //Log出力
                            catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
                        }
                    }
                    deviceComingAction = null;
                    return listTemp;
                    statu = 1;
                    return this.GetDeviceByGatewayID(HdlGatewayLogic.Current.GetGatewayId(zbGateway));
                }
            }
            zbGateway.LastDateTime = DateTime.Now;
@@ -1863,6 +1857,7 @@
                    string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
                    this.ShowTipMsg(msg);
                }
                statu = -1;
                return null;
            }
@@ -1915,8 +1910,6 @@
                                //网关里面有可能会有重复的回路
                                if (listCheck.Contains(mainkeys) == false)
                                {
                                    //回调函数
                                    deviceComingAction?.Invoke(device);
                                    listDevice.Add(device);
                                    listCheck.Add(mainkeys);
@@ -1965,6 +1958,7 @@
                        msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "回复超时", false);
                        this.ShowTipMsg(msg);
                    }
                    statu = -1;
                    return null;
                }
                else
@@ -1975,12 +1969,9 @@
                        string msg = Language.StringByID(R.MyInternationalizationString.uNetworkUnStableAndDeviceInfoIsNotFull);
                        this.ShowTipMsg(msg);
                    }
                    statu = 2;
                }
            }
            //回调函数(接收完成)
            deviceComingAction = null;
            }
            return listDevice;
        }
@@ -2186,9 +2177,9 @@
            this.dicDeviceModelIdEnum["MPT2/R2-ZB.18"] = "202-200";//2按键触摸面板
            this.dicDeviceModelIdEnum["MPT1/R1-ZB.18"] = "203-200";//12按键触摸面板
            this.dicDeviceModelIdEnum["MPT4-ZB.18"] = "210-200";//4按键触摸面板(只带电源底座)
            this.dicDeviceModelIdEnum["MPT4R4L/S-ZB1.8"] = "220-200";//简约4按键面板
            this.dicDeviceModelIdEnum["MPT3R3L/S-ZB1.8"] = "221-200";//简约3按键面板
            this.dicDeviceModelIdEnum["MPT2R2L/S-ZB1.8"] = "222-200";//简约2按键面板
            this.dicDeviceModelIdEnum["MPT4R4L/S-ZB.18"] = "220-200";//简约4按键面板
            this.dicDeviceModelIdEnum["MPT3R3L/S-ZB.18"] = "221-200";//简约3按键面板
            this.dicDeviceModelIdEnum["MPT2R2L/S-ZB.18"] = "222-200";//简约2按键面板
            //=========★★PIR传感器类(1200-1299)★★=========
            this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200";//pir传感器220
@@ -2223,6 +2214,8 @@
            this.dicDeviceModelIdEnum["MBUS/GW-ZB.10"] = "4200-4200";//zigbee转buspro协议转换器
            this.dicDeviceModelIdEnum["M485/GW-ZB.10"] = "4201-4200";//zigbee转485协议转换器
            //✩✩✩✩✩需要交换的模块ID✩✩✩✩✩
            this.dicDeviceModelIdChanged = new Dictionary<string, string>();
            //=========★★安防类传感器类★★=========
@@ -2233,6 +2226,8 @@
            this.dicDeviceModelIdChanged["MULTI-WATE--EA02"] = "MSW01/M-ZB.10";//水浸传感器
            this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//紧急按键
            //✩✩✩✩✩需要共有的图片对象✩✩✩✩✩
            this.dicPictrueShard = new Dictionary<string, string>();
            this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//简约4按键面板 沿用 4按键的图标
ZigbeeApp/Shared/Common/DeviceUI.cs
@@ -339,6 +339,10 @@
            {
                return Language.StringByID(R.MyInternationalizationString.UnallocatedArea);
            }
            if(string.IsNullOrEmpty(room.FloorId))
            {
                return room.Name;
            }
            var floorName = Config.Instance.Home.GetFloorNameById(room.FloorId);
            if (floorName == null)
            {
ZigbeeApp/Shared/Common/Room.cs
@@ -337,13 +337,13 @@
            }
            Config.Instance.Home.InitFloor();
            RefreshRoomListView();
            CurrentRoom.RefreshRoomListView();
        }
        /// <summary>
        /// 刷新房间视图列表
        /// </summary>
        public static void RefreshRoomListView()
        public void RefreshRoomListView()
        {
            Application.RunOnMainThread(() =>
            {
@@ -494,6 +494,9 @@
            Global.DeleteFilebyHomeId(roomFilePath);
            Lists.Remove(room);
            HdlAutoBackupLogic.DeleteFile(roomFilePath);
            CurrentRoom.RefreshRoomListView();
            return true;
        }
@@ -790,6 +793,25 @@
                return true;
            }
            return false;
        }
        /// <summary>
        /// 获取房间所在区域
        /// 楼层,房间名
        /// </summary>
        /// <returns></returns>
        public string GetZoneName()
        {
            if (string.IsNullOrEmpty(FloorId))
            {
                return Name;
            }
            var floorName = Config.Instance.Home.GetFloorNameById(FloorId);
            if (floorName == null)
            {
                return Name;
            }
            return $"{floorName},{Name}";
        }
        #endregion
@@ -1091,16 +1113,16 @@
        /// <param name="sceneIconPath">背景图片,不包含住宅路径 如果iconPathType=1或者2 需要拼接住宅 变成 住宅/sceneIconPath</param>
        /// <param name="commons">Commons.</param>
        /// <param name="iconPathType">I场景背景图片来源类型 图片来源 0--本地图库 1--拍照 2--系统图库 默认0</param>
        public async System.Threading.Tasks.Task<int> AddScene(string sceneName, string sceneIconPath, List<ZigBee.Device.Scene.AddSceneMemberData> commons, int iconPathType = 0)
        public async System.Threading.Tasks.Task<int> AddScene(string sceneName, string sceneIconPath, List<ZigBee.Device.Scene.AddSceneMemberData> commons, int iconPathType)
        {
            var scenes = GetSceneUIsByFloorId(FloorId);
            if(scenes!=null && scenes.Count>0)
            {
                if (scenes.Find(s => s.Name == sceneName) != null)
                {
                    return -1;
                }
            }
            //var scenes = GetSceneUIsByFloorId(FloorId);
            //if(scenes!=null && scenes.Count>0)
            //{
            //    if (scenes.Find(s => s.Name == sceneName) != null)
            //    {
            //        return -1;
            //    }
            //}
            var getSceneIdAllData = await ZigBee.Device.Scene.GetSceneNewIdAsync(sceneName);
            if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null)
@@ -1140,26 +1162,18 @@
            //加入成功
            if (result)
            {
                //iconPathType=0 直接传值, iconPathType=1和iconPathType=2需要拼接住宅路径
                var fullPath = sceneIconPath;
                if (iconPathType == 1 || iconPathType == 2)
                {
                    Common.Room.CurrentRoom.MoveBackGroundIamageFileToDirectory(sceneIconPath, $"{Config.Instance.FullPath}/{sceneIconPath}");
                    fullPath = $"{Config.Instance.FullPath}/{sceneIconPath}";
                }
                var sceneUI = new SceneUI
                {
                    Name = sceneName,
                    Id = getSceneIdData.NewScenesId,
                    IconPath = fullPath,
                    IconPath = sceneIconPath,
                    IconPathType = iconPathType,
                    AddSceneMemberDataList= commons
                };
                sceneUI.Save();
                SceneUIList.Add(sceneUI);
                SceneUIFilePathList.Add(sceneUI.FileName);
                sceneUI.Save();
                Save();
                HdlAutoBackupLogic.AddOrEditorFile(sceneUI.FileName);
                return 1;
            }
            return 0;
@@ -1205,15 +1219,10 @@
        /// <summary>
        /// 是否是收藏设备
        /// </summary>
        /// <param name="room"></param>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public bool IsCollectInRoom(Room room,string filePath)
        public bool IsCollectInRoom(string filePath)
        {
            if(room.IsLove)
            {
                return true;
            }
            if (GetLoveRoom().DeviceUIFilePathList.Find((obj) => obj == filePath) == null)
            {
                return false;
ZigbeeApp/Shared/Common/ZigbeeColor.cs
@@ -251,9 +251,13 @@
        /// </summary>
        public uint GXCWaveSeekBarUnSelectedColor = 0xFFEBEBED;
        /// <summary>
        /// GXCWaveSeekBarColor 0xFFFE4F35
        /// GXCWaveSeekBarColor_Start 0xFFFF6C2C
        /// </summary>
        public uint GXCWaveSeekBarColor = 0xFFFE4F35;
        public uint GXCWaveSeekBarColor_Start = 0xFFFF6C2C;
        /// <summary>
        /// GXCWaveSeekBarColor_End 0xFFFD3040
        /// </summary>
        public uint GXCWaveSeekBarColor_End = 0xFFFD3040;
        /// <summary>
        /// 0xFFFDB500
        /// </summary>
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
Binary files differ
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
Binary files differ
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll
Binary files differ
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll
Binary files differ
ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -13,7 +13,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI, Common.Room> action;
        /// <summary>
        /// 收藏按钮
@@ -362,8 +362,8 @@
        public override void RemoveFromParent()
        {
            ZigBee.Device.ZbGateway.StatusList.Remove(this);
            //action();
            //action = null;
            action(device, room);
            action = null;
            RemoveUpdateControlDeviceStatuAction();
            HomePage.Instance.ScrollEnabled = true;
            if (IsDrawerLockMode)
@@ -413,8 +413,7 @@
                }
            }
            var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (de == null)
            if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName)==false)
            {
                collectionBtn.IsSelected = false;
            }
@@ -520,18 +519,27 @@
            };
            itemView.AddChidren(indoorTemperatureBtn);
            mArcScaleSeekBar = new ArcScaleSeekBar
            var mArcScaleSeekBarFL = new FrameLayout
            {
                Y = Application.GetRealHeight(412),
                Width = Application.GetRealWidth(671),
                Height = Application.GetRealHeight(671),
                Width = Application.GetMinRealAverage(671),
                Height = Application.GetMinRealAverage(671),
                Gravity = Gravity.CenterHorizontal
            };
            itemView.AddChidren(mArcScaleSeekBarFL);
            mArcScaleSeekBar = new ArcScaleSeekBar
            {
                Width = Application.GetMinRealAverage(671),
                Height = Application.GetMinRealAverage(671),
                Gravity = Gravity.CenterHorizontal,
                MinValue = ACControlBase.Temperature_Low,
                MaxValue = ACControlBase.Temperature_High,
                Progress = ACControlBase.GetCurrentModeTemperature(ac),
                IsClickable = ACControlBase.IsOpen(ac)
                IsClickable = ACControlBase.IsOpen(ac),
                ProgressBarUnitSring = string.Empty
            };
            itemView.AddChidren(mArcScaleSeekBar);
            mArcScaleSeekBarFL.AddChidren(mArcScaleSeekBar);
            if(ACControlBase.IsOpen(ac))
            {
                mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
@@ -561,35 +569,47 @@
            currentModeBtn = new Button()
            {
                Y = Application.GetRealHeight(565),
                Height = Application.GetRealHeight(80),
                Y = Application.GetMinRealAverage(187),
                Height = Application.GetRealHeight(50),
                Width = Application.GetRealWidth(200),
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                Gravity = Gravity.CenterHorizontal,
                Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode),
                TextSize=12
                TextSize = 12
            };
            itemView.AddChidren(currentModeBtn);
            mArcScaleSeekBarFL.AddChidren(currentModeBtn);
            reduceTemperatureBtn = new Button()
            {
                X = Application.GetRealWidth(268),
                Y = Application.GetRealHeight(650),
                X = Application.GetMinRealAverage(132),
                Y = Application.GetMinRealAverage(268),
                Width = Application.GetMinRealAverage(80),
                Height = Application.GetMinRealAverage(80),
                UnSelectedImagePath = "AC/Reduce.png"
            };
            itemView.AddChidren(reduceTemperatureBtn);
            mArcScaleSeekBarFL.AddChidren(reduceTemperatureBtn);
            addTemperatureBtn = new Button()
            {
                X = Application.GetRealWidth(610),
                Y = Application.GetRealHeight(650),
                X = Application.GetMinRealAverage(452),
                Y = Application.GetMinRealAverage(268),
                Width = Application.GetMinRealAverage(80),
                Height = Application.GetMinRealAverage(80),
                UnSelectedImagePath = "AC/Add.png"
            };
            itemView.AddChidren(addTemperatureBtn);
            mArcScaleSeekBarFL.AddChidren(addTemperatureBtn);
            var uintBtn = new Button
            {
                Y = Application.GetMinRealAverage(369),
                Height = Application.GetRealHeight(60),
                Width = Application.GetRealWidth(100),
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                Gravity = Gravity.CenterHorizontal,
                Text = "℃",
                TextSize = 18
            };
            mArcScaleSeekBarFL.AddChidren(uintBtn);
            FanSwingModeBtn = new Button()
            {
@@ -881,6 +901,12 @@
        /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
        private void ShowChangeMode_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
        {
            if (HadSupportModel() == false)
            {
                CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AC_Model_None));
                return;
            }
            int modeItem_X = 80;
            int modeItem_Height = 150;
            int modeItem_Width = 449;
@@ -1058,6 +1084,24 @@
            ac.currentSystemMode = (int)acMode;
            mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
            ac.SetSystemModeAsync(acMode);
        }
        /// <summary>
        /// 是否配置了模式
        /// </summary>
        /// <returns></returns>
        private bool HadSupportModel()
        {
            bool hadMode = false;
            foreach (var m in ac.listSupportMode)
            {
                if (m == 1)
                {
                    hadMode = true;
                    break;
                }
            }
            return hadMode;
        }
        #endregion
@@ -1393,9 +1437,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev, curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -1134,30 +1134,14 @@
                                    };
                                    deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
                                    {
                                        if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
                                        var lightControl = new Phone.Device.Light.OnOffControl();
                                        UserView.HomePage.Instance.AddChidren(lightControl);
                                        UserView.HomePage.Instance.PageIndex += 1;
                                        lightControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        lightControl.action += (curDev, curRoom) =>
                                        {
                                            var lightControl = new Phone.Device.Light.OnOffControl();
                                            UserView.HomePage.Instance.AddChidren(lightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            //lightControl.action = RefreshBodyView;
                                            lightControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        }
                                        else if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
                                        {
                                            var lightControl = new Phone.Device.Light.PlugControl();
                                            UserView.HomePage.Instance.AddChidren(lightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            //lightControl.action = RefreshBodyView;
                                            lightControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        }
                                        else
                                        {
                                            var lightControl = new Phone.Device.Light.LightControl();
                                            UserView.HomePage.Instance.AddChidren(lightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            //lightControl.action = RefreshBodyView;
                                            lightControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        }
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1168,21 +1152,7 @@
                                        detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                        detailInfo.EditAction += (curDevice, curRoom) =>
                                        {
                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                            {
                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                                deviceRow.RemoveFromParent();
                                                sameTypeList.Remove(deviceUI);
                                                if (sameTypeList.Count == 0)
                                                {
                                                    RefreshFunction(Common.Room.CurrentRoom);
                                                }
                                            }
                                            else
                                            {
                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                            }
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1265,8 +1235,13 @@
                                        var lightControl = new Phone.Device.Light.AirSwitchControl();
                                        UserView.HomePage.Instance.AddChidren(lightControl);
                                        UserView.HomePage.Instance.PageIndex += 1;
                                        //lightControl.action = RefreshBodyView;
                                        lightControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        lightControl.action += (curDev, curRoom) =>
                                        {
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1277,21 +1252,8 @@
                                        detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                        detailInfo.EditAction += (curDevice, curRoom) =>
                                        {
                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                            {
                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                                deviceRow.RemoveFromParent();
                                                sameTypeList.Remove(deviceUI);
                                                if (sameTypeList.Count == 0)
                                                {
                                                    RefreshFunction(Common.Room.CurrentRoom);
                                                }
                                            }
                                            else
                                            {
                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                            }
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1376,8 +1338,12 @@
                                        UserView.HomePage.Instance.AddChidren(dimmableLightControl);
                                        UserView.HomePage.Instance.PageIndex += 1;
                                        UserView.HomePage.Instance.ScrollEnabled = false;
                                        //dimmableLightControl.action = RefreshBodyView;
                                        dimmableLightControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        dimmableLightControl.action += (curDev, curRoom) =>
                                        {
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1388,21 +1354,7 @@
                                        detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                        detailInfo.EditAction += (curDevice, curRoom) =>
                                        {
                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                            {
                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                                deviceRow.RemoveFromParent();
                                                sameTypeList.Remove(deviceUI);
                                                if (sameTypeList.Count == 0)
                                                {
                                                    RefreshFunction(Common.Room.CurrentRoom);
                                                }
                                            }
                                            else
                                            {
                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                            }
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1447,7 +1399,6 @@
                                    var deviceRow = new CategoryFunctionRow(0, 35);
                                    deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                    //deviceRow.SetOnLineStatu(ac.IsOnline == 1);
                                    deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
                                    deviceRow.IsSelected = ac.currentSystemMode != 1;
                                    deviceTypeRowLayout.AddChidren(deviceRow);
@@ -1490,8 +1441,12 @@
                                        UserView.HomePage.Instance.AddChidren(acControl);
                                        UserView.HomePage.Instance.PageIndex += 1;
                                        UserView.HomePage.Instance.ScrollEnabled = false;
                                        //rollerShadeControl.action = RefreshBodyView;
                                        acControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        acControl.action += (curDev, curRoom) =>
                                        {
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1502,21 +1457,8 @@
                                        detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                        detailInfo.EditAction += (curDevice, curRoom) =>
                                        {
                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                            {
                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                                deviceRow.RemoveFromParent();
                                                sameTypeList.Remove(deviceUI);
                                                if (sameTypeList.Count == 0)
                                                {
                                                    RefreshFunction(Common.Room.CurrentRoom);
                                                }
                                            }
                                            else
                                            {
                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                            }
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1588,8 +1530,11 @@
                                        UserView.HomePage.Instance.AddChidren(rollerShadeControl);
                                        UserView.HomePage.Instance.PageIndex += 1;
                                        UserView.HomePage.Instance.ScrollEnabled = false;
                                        //rollerShadeControl.action = RefreshBodyView;
                                        rollerShadeControl.Show(deviceUI, Common.Room.CurrentRoom);
                                        rollerShadeControl.action += (curDev, curRoom) =>
                                        {
                                            ReFreshDeviceActionForWin(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1600,21 +1545,7 @@
                                        detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                        detailInfo.EditAction += (curDevice, curRoom) =>
                                        {
                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                            {
                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                                deviceRow.RemoveFromParent();
                                                sameTypeList.Remove(deviceUI);
                                                if (sameTypeList.Count == 0)
                                                {
                                                    RefreshFunction(Common.Room.CurrentRoom);
                                                }
                                            }
                                            else
                                            {
                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                            }
                                            ReFreshDeviceActionForWin(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1626,7 +1557,6 @@
                                        deviceTypeRowLayout.AddRightView(editBtn);
                                        editBtn.MouseUpEventHandler += deviceDetailHandler;
                                    }
                                }
                            }
                            else if (deviceUI.CommonDevice.Type == DeviceType.DoorLock)
@@ -1653,21 +1583,7 @@
                                    detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                    detailInfo.EditAction += (curDevice, curRoom) =>
                                    {
                                        if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                        {
                                            Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                            deviceRow.RemoveFromParent();
                                            sameTypeList.Remove(deviceUI);
                                            if (sameTypeList.Count == 0)
                                            {
                                                RefreshFunction(Common.Room.CurrentRoom);
                                            }
                                        }
                                        else
                                        {
                                            deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                            deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                        }
                                        ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                    };
                                };
                                var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1698,21 +1614,7 @@
                                    detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                    detailInfo.EditAction += (curDevice, curRoom) =>
                                    {
                                        if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                        {
                                            Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                            deviceRow.RemoveFromParent();
                                            sameTypeList.Remove(deviceUI);
                                            if (sameTypeList.Count == 0)
                                            {
                                                RefreshFunction(Common.Room.CurrentRoom);
                                            }
                                        }
                                        else
                                        {
                                            deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                            deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                        }
                                        ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                    };
                                };
                                var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1780,21 +1682,7 @@
                                        detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                        detailInfo.EditAction += (curDevice, curRoom) =>
                                        {
                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                            {
                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                                deviceRow.RemoveFromParent();
                                                sameTypeList.Remove(deviceUI);
                                                if (sameTypeList.Count == 0)
                                                {
                                                    RefreshFunction(Common.Room.CurrentRoom);
                                                }
                                            }
                                            else
                                            {
                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                            }
                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                        };
                                    };
                                    var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1825,21 +1713,7 @@
                                    detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                    detailInfo.EditAction += (curDevice, curRoom) =>
                                    {
                                        if (curRoom.Id != Common.Room.CurrentRoom.Id)
                                        {
                                            Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                            deviceRow.RemoveFromParent();
                                            sameTypeList.Remove(deviceUI);
                                            if (sameTypeList.Count == 0)
                                            {
                                                RefreshFunction(Common.Room.CurrentRoom);
                                            }
                                        }
                                        else
                                        {
                                            deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                            deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                                        }
                                        ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                    };
                                };
                                var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1852,7 +1726,6 @@
                                    editBtn.MouseUpEventHandler += deviceDetailHandler;
                                }
                            }
                            //删除设备
                            EventHandler<MouseEventArgs> delEvent = (delSender, delE) =>
@@ -1874,7 +1747,7 @@
                                        sameTypeList.Remove(deviceUI);
                                        if (Common.Room.CurrentRoom.GetLoveRoom().DeviceUIList.Find((obj) => obj.FileName == deviceUI.FileName) != null)
                                        {
                                            Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                                            Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName);
                                        }
                                    }
                                    if (sameTypeList.Count == 0)
@@ -1901,6 +1774,93 @@
        }
        /// <summary>
        /// ReFreshDeviceAction
        /// </summary>
        /// <param name="curRoom"></param>
        /// <param name="sameTypeList"></param>
        /// <param name="devListScrolView"></param>
        /// <param name="deviceRow"></param>
        private void ReFreshDeviceAction(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionRow deviceRow)
        {
            if (Common.Room.CurrentRoom.IsLove)
            {
                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false)
                {
                    devListScrolView.RemoveViewByTag(deviceUI);
                    sameTypeList.Remove(deviceUI);
                    if (sameTypeList.Count == 0)
                    {
                        RefreshFunction(Common.Room.CurrentRoom);
                    }
                }
            }
            else
            {
                if (curRoom.Id != Common.Room.CurrentRoom.Id)
                {
                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                    devListScrolView.RemoveViewByTag(deviceUI);
                    sameTypeList.Remove(deviceUI);
                    if (sameTypeList.Count == 0)
                    {
                        RefreshFunction(Common.Room.CurrentRoom);
                    }
                }
                else
                {
                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                }
            }
        }
        /// <summary>
        /// ReFreshDeviceAction
        /// </summary>
        /// <param name="curRoom"></param>
        /// <param name="sameTypeList"></param>
        /// <param name="devListScrolView"></param>
        /// <param name="deviceRow"></param>
        private void ReFreshDeviceActionForWin(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionForWinRow deviceRow)
        {
            if (Common.Room.CurrentRoom.IsLove)
            {
                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false)
                {
                    devListScrolView.RemoveViewByTag(deviceUI);
                    sameTypeList.Remove(deviceUI);
                    if (sameTypeList.Count == 0)
                    {
                        RefreshFunction(Common.Room.CurrentRoom);
                    }
                }
            }
            else
            {
                if (curRoom.Id != Common.Room.CurrentRoom.Id)
                {
                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
                    devListScrolView.RemoveViewByTag(deviceUI);
                    sameTypeList.Remove(deviceUI);
                    if (sameTypeList.Count == 0)
                    {
                        RefreshFunction(Common.Room.CurrentRoom);
                    }
                }
                else
                {
                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                }
            }
        }
        /// <summary>
        /// AddRoomView
        /// </summary>
        private void AddRoomView()
ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
@@ -354,16 +354,26 @@
            };
            bodyFrameLayout.AddChidren(imgFL);
            var backGround1 = new ImageView()
            {
                Y = Application.GetRealHeight(46),
                Width = Application.GetMinRealAverage(916),
                Height = Application.GetMinRealAverage(487),
                Gravity = Gravity.CenterHorizontal,
                ImagePath = "Room/Room_Rectangle.png"
            };
            imgFL.AddChidren(backGround1);
            backGround = new ImageView()
            {
                Width = Application.GetMinRealAverage(930),
                Height = Application.GetMinRealAverage(464),
                Gravity = Gravity.Center,
                Y = Application.GetRealHeight(46),
                Width = Application.GetMinRealAverage(887),
                Height = Application.GetMinRealAverage(444),
                Gravity = Gravity.CenterHorizontal,
                Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius),
                ImagePath = "SceneIcon/3.jpg"
            };
            imgFL.AddChidren(backGround);
            backGround.SetViewShadow(true);
            var infoFL = new FrameLayout
            {
@@ -604,6 +614,10 @@
                    //通过相机拍照裁剪
                    CropImage.TakePicture((imagePath) =>
                    {
                        if (string.IsNullOrEmpty(imagePath))
                        {
                            return;
                        }
                        if (isModify)
                        {
                            if (IconPathType != 0)
@@ -629,6 +643,10 @@
                    //从相册选择图片裁剪
                    CropImage.SelectPicture((imagePath) =>
                    {
                        if (string.IsNullOrEmpty(imagePath))
                        {
                            return;
                        }
                        if (isModify)
                        {
                            if (IconPathType != 0)
@@ -660,53 +678,13 @@
            //区域
            EventHandler<MouseEventArgs> zoneHander = (sender, e) =>
            {
                List<string> floorIds = new List<string> { };
                List<string> floorNames = new List<string> { };
                List<List<string>> roomNames = new List<List<string>> { };
                List<List<Common.Room>> rooms = new List<List<Common.Room>> { };
                List<Common.Room> rs = new List<Common.Room> { };
                List<string> rNames = new List<string> { };
                if (Config.Instance.Home.FloorDics.Count > 0)
                var zone = new SelectZone();
                zone.Init();
                zone.ZoneAction += (selectRoom) =>
                {
                    foreach (var floor in Config.Instance.Home.FloorDics)
                    {
                        if (Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count > 0)
                        {
                            floorIds.Add(floor.Key);
                            floorNames.Add(floor.Value);
                            roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key));
                            rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key));
                        }
                    }
                    PickerView.ShowSecondary(floorNames, roomNames, (index1, index2) =>
                    {
                        curRoom = rooms[index1][index2];
                        zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}");
                    }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone),
                   Language.StringByID(R.MyInternationalizationString.Confrim),
                   Language.StringByID(R.MyInternationalizationString.Cancel));
                }
                else
                {
                    for (int i = 0; i < Common.Room.Lists.Count; i++)
                    {
                        var r = Common.Room.Lists[i];
                        if (r.IsLove)
                        {
                            continue;
                        }
                        rs.Add(r);
                        rNames.Add(r.Name);
                    }
                    PickerView.Show(rNames, (index1) =>
                    {
                        curRoom = rs[index1];
                        zoneRow.SetTitle(rs[index1].Name);
                    }, 0, Language.StringByID(R.MyInternationalizationString.BelongZone),
                   Language.StringByID(R.MyInternationalizationString.Confrim),
                   Language.StringByID(R.MyInternationalizationString.Cancel));
                }
                    curRoom = selectRoom;
                    zoneRow.SetTitle(selectRoom.GetZoneName());
                };
            };
            zoneRow.ClickBtn.MouseUpEventHandler += zoneHander;
@@ -919,13 +897,12 @@
                            if (OldIconPathType != 0)
                            {
                                Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
                                HdlAutoBackupLogic.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
                                HdlAutoBackupLogic.DeleteFile(OldBackgroundImagePath);
                            }
                            if (IconPathType == 1 || IconPathType == 2)
                            {
                                Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
                                HdlAutoBackupLogic.AddOrEditorFile(System.IO.Path.Combine(Config.Instance.FullPath, fileName));
                                HdlAutoBackupLogic.AddOrEditorFile(fileName);
                                modifySceneUI.IconPath = fileName;
                            }
                            else
@@ -1078,6 +1055,7 @@
                            if (IconPathType == 1 || IconPathType == 2)
                            {
                                Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
                                HdlAutoBackupLogic.AddOrEditorFile(fileName);
                                imgPath = fileName;
                            }
                            else
@@ -1138,7 +1116,7 @@
                                }
                            }
                            var result = await curRoom.AddScene(nameRow.NameText.Text, imgPath, memberDataList);
                            var result = await curRoom.AddScene(nameRow.NameText.Text, imgPath, memberDataList, IconPathType);
                            if (result == 1)
                            {
                                AddAction?.Invoke();
@@ -1475,7 +1453,7 @@
                dialog.RemoveFromParent();
            };
            open.SeekBar.ProgressChanged += (sender, e) =>
            open.SeekBar.OnProgressChangedEvent += (sender, e) =>
            {
                open.IsSelected = true;
                shut.IsSelected = false;
@@ -1493,7 +1471,7 @@
                {
                    open.IsSelected = true;
                    shut.IsSelected = false;
                    open.SetProgress(sceneTarget.TaskList[0].Data2);
                    open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2);
                }
            }
@@ -1641,7 +1619,7 @@
                dialog.RemoveFromParent();
            };
            open.SeekBar.ProgressChanged += (sender, e) =>
            open.SeekBar.OnProgressChangedEvent += (sender, e) =>
            {
                open.IsSelected = true;
                shut.IsSelected = false;
@@ -1659,7 +1637,7 @@
                {
                    open.IsSelected = true;
                    shut.IsSelected = false;
                    open.SetProgress(sceneTarget.TaskList[0].Data1);
                    open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1);
                }
            }
ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
@@ -448,11 +448,13 @@
                deviceListScrolView.AddChidren(deviceTypeRowLayout);
                var deviceRow = new FunctionRow(0, 35);
                deviceTypeRowLayout.AddChidren(deviceRow);
                deviceRow.Init(device.IconPath, device.OnlineIconPath, true);
                deviceRow.SetTitle(device.CommonDevice.DeviceEpointName);
                deviceRow.IsSelected = true;
                deviceRow.HideSwitchBtn(false);
                deviceRow.NameBtn.BackgroundColor = ZigbeeColor.Current.GXCRedColor;
                deviceTypeRowLayout.AddChidren(deviceRow);
                deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
                {
@@ -794,7 +796,7 @@
                dialog.RemoveFromParent();
            };
            open.SeekBar.ProgressChanged += (sender, e) =>
            open.SeekBar.OnProgressChangedEvent += (sender, e) =>
            {
                open.IsSelected = true;
                shut.IsSelected = false;
@@ -812,7 +814,7 @@
                {
                    open.IsSelected = true;
                    shut.IsSelected = false;
                    open.SetProgress(sceneTarget.TaskList[0].Data2);
                    open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2);
                }
            }
@@ -960,7 +962,7 @@
                dialog.RemoveFromParent();
            };
            open.SeekBar.ProgressChanged += (sender, e) =>
            open.SeekBar.OnProgressChangedEvent += (sender, e) =>
            {
                open.IsSelected = true;
                shut.IsSelected = false;
@@ -978,7 +980,7 @@
                {
                    open.IsSelected = true;
                    shut.IsSelected = false;
                    open.SetProgress(sceneTarget.TaskList[0].Data1);
                    open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1);
                }
            }
ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
@@ -134,7 +134,7 @@
            {
                Config.Instance.Home.CurrentFloorId = (sender as CommonForm.LeftIconButtonRow).Tag.ToString();
                Config.Instance.Home.Save();
                Common.Room.RefreshRoomListView();
                Common.Room.CurrentRoom.RefreshRoomListView();
            }
            RemoveView();
            FloorAction?.Invoke((sender as CommonForm.LeftIconButtonRow).Tag.ToString());
ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
@@ -48,6 +48,7 @@
        /// </summary>
        public override void RemoveFromParent()
        {
            EditAction = null;
            base.RemoveFromParent();
        }
        #endregion
@@ -75,7 +76,7 @@
            AddTop();
            AddBodyView(device);
            AddBodyView(device,room);
        }
@@ -101,7 +102,7 @@
        /// <summary>
        /// AddBodyView
        /// </summary>
        public void AddBodyView(DeviceUI device)
        public void AddBodyView(DeviceUI device, Common.Room room)
        {
            bodyFrameLayout = new FrameLayout()
            {
@@ -166,7 +167,7 @@
            };
            bodyFrameLayout.AddChidren(infoFL);
            var rectCornerID = HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight;
            infoFL.SetCornerWithSameRadius(Application.GetRealHeight(50), rectCornerID);
            infoFL.SetCornerWithSameRadius(Application.GetRealHeight(58), rectCornerID);
            var tipBtn = new Button
            {
@@ -181,32 +182,65 @@
            };
            infoFL.AddChidren(tipBtn);
            var nameRow = new DeviceInfoEditRow(170);
            var infoScrolView = new VerticalScrolViewLayout
            {
                Y = Application.GetRealHeight(170-12),
                Height = Application.GetRealHeight(600),
                ScrollEnabled = false,
                VerticalScrollBarEnabled = false
            };
            infoFL.AddChidren(infoScrolView);
            var nameFL = new FrameLayout
            {
                Height = Application.GetRealHeight(127 + 12)
            };
            infoScrolView.AddChidren(nameFL);
            var nameRow = new DeviceInfoEditRow(12);
            nameRow.Init();
            nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.FunctionName)} : ");
            nameRow.SetTitle(string.IsNullOrEmpty(device.CommonDevice.DeviceEpointName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : device.CommonDevice.DeviceEpointName);
            infoFL.AddChidren(nameRow);
            nameFL.AddChidren(nameRow);
            var zoneRow = new DeviceInfoRow(308);
            var zoneFL = new FrameLayout
            {
                Height = Application.GetRealHeight(127 + 12)
            };
            if (room != null && room.IsLove == false)
            {
                infoScrolView.AddChidren(zoneFL);
            }
            var zoneRow = new DeviceInfoRow(12);
            zoneRow.Init();
            zoneRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongZone)} : ");
            zoneRow.SetTitle(roomName);
            infoFL.AddChidren(zoneRow);
            zoneFL.AddChidren(zoneRow);
            var modelRow = new DeviceInfoRow(446);
            var modelFL = new FrameLayout
            {
                Height = Application.GetRealHeight(127 + 12)
            };
            infoScrolView.AddChidren(modelFL);
            var modelRow = new DeviceInfoRow(12);
            modelRow.Init();
            modelRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongModel)} : ");
            modelRow.SetTitle(string.IsNullOrEmpty(device.CommonDevice.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : device.CommonDevice.DeviceName);
            modelRow.HideNext(true);
            infoFL.AddChidren(modelRow);
            modelFL.AddChidren(modelRow);
            if (device.CommonDevice.Type==ZigBee.Device.DeviceType.OnOffOutput)
            if (device.CommonDevice.Type==DeviceType.OnOffOutput || device.CommonDevice.Type==DeviceType.AirSwitch)
            {
                functionTypeRow = new DeviceInfoRow(585);
                var typeFL = new FrameLayout
                {
                    Height = Application.GetRealHeight(127 + 12)
                };
                infoScrolView.AddChidren(typeFL);
                functionTypeRow = new DeviceInfoRow(12);
                functionTypeRow.Init();
                functionTypeRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.FunctionType)} : ");
                //functionTypeRow.SetTitle(device.CommonDevice.DfunctionType);
                infoFL.AddChidren(functionTypeRow);
                typeFL.AddChidren(functionTypeRow);
                var dfunctionType = device.CommonDevice.DfunctionType;
                //功能类型的翻译名字
@@ -276,75 +310,23 @@
                        }
                    };
                };
                //sharedRow = new DeviceInfoRow(723);
                //sharedRow.Init();
                //sharedRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.Share)} : ");
                //sharedRow.SetTitle("2人");
                //infoFL.AddChidren(sharedRow);
            }
            else
            {
                //sharedRow = new DeviceInfoRow(585);
                //sharedRow.Init();
                //sharedRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.Share)} : ");
                //sharedRow.SetTitle("2人");
                //infoFL.AddChidren(sharedRow);
            }
            var confirmBtn = new CommonForm.CompleteButton(962, 907, 127);
            confirmBtn.SetTitle(R.MyInternationalizationString.Confrim);
            var confirmBtn = new CommonForm.CompleteButton(962, 900, 127);
            confirmBtn.SetTitle(R.MyInternationalizationString.Save);
            infoFL.AddChidren(confirmBtn);
            #region event
            EventHandler<MouseEventArgs> selectZoneEvent = (sender, e) =>
            {
                List<string> floorIds = new List<string> { };
                List<string> floorNames = new List<string> { };
                List<List<string>> roomNames = new List<List<string>> { };
                List<List<Common.Room>> rooms = new List<List<Common.Room>> { };
                List<Common.Room> rs = new List<Common.Room> { };
                List<string> rNames = new List<string> { };
                if (Config.Instance.Home.FloorDics.Count>0)
                var zone = new SelectZone();
                zone.Init();
                zone.ZoneAction += (selectRoom) =>
                {
                    foreach (var floor in Config.Instance.Home.FloorDics)
                    {
                        floorIds.Add(floor.Key);
                        floorNames.Add(floor.Value);
                        if (Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count > 0)
                        {
                            roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key));
                            rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key));
                        }
                    }
                    PickerView.ShowSecondary(floorNames, roomNames, (index1, index2) =>
                    {
                        curRoom = rooms[index1][index2];
                        zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}");
                    }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone),
                   Language.StringByID(R.MyInternationalizationString.Confrim),
                   Language.StringByID(R.MyInternationalizationString.Cancel));
                }
                else
                {
                    for(int i=0;i<Common.Room.Lists.Count;i++)
                    {
                        var r = Common.Room.Lists[i];
                        if (r.IsLove)
                        {
                            continue;
                        }
                        rs.Add(r);
                        rNames.Add(r.Name);
                    }
                    PickerView.Show(rNames, (index1) =>
                    {
                        curRoom = rs[index1];
                        zoneRow.SetTitle(rs[index1].Name);
                    }, 0,Language.StringByID(R.MyInternationalizationString.BelongZone),
                   Language.StringByID(R.MyInternationalizationString.Confrim),
                   Language.StringByID(R.MyInternationalizationString.Cancel));
                }
                    curRoom = selectRoom;
                    zoneRow.SetTitle(selectRoom.GetZoneName());
                };
            };
            zoneRow.ClickBtn.MouseUpEventHandler += selectZoneEvent;
@@ -370,10 +352,10 @@
                    CommonPage.Loading.Start();
                    if (device.CommonDevice == null)
                    {
                        CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
                        CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
                        return;
                    }
                    if (device.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
                    if (device.CommonDevice.Type == DeviceType.OnOffOutput || device.CommonDevice.Type == DeviceType.AirSwitch)
                    {
                        if (device.IsCustomizeImage == false)
                        {
ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs
@@ -99,14 +99,14 @@
            NameBtn = new Button()
            {
                X = Application.GetRealWidth(200),
                Width = Application.GetRealWidth(500),
                Width = Application.GetRealWidth(600),
                Height = Application.GetRealHeight(80),
                Gravity = Gravity.CenterVertical,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
                TextAlignment = TextAlignment.CenterLeft,
                Tag = Tag,
                TextSize=14
                TextSize = 14
            };
            AddChidren(NameBtn);
ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
@@ -83,7 +83,7 @@
                        //是否为当前设备
                        if ((temperDevice?.DeviceEpoint != common.DeviceEpoint || temperDevice?.DeviceAddr != common.DeviceAddr) && (humidDevice?.DeviceEpoint != common.DeviceEpoint || humidDevice?.DeviceAddr != common.DeviceAddr) )
                        {
                            //return;
                            return;
                        }
                        //if (common.Type == DeviceType.TemperatureSensor)
@@ -308,6 +308,8 @@
                var editRoom = new Device.Room.EditRoom();
                HomePage.Instance.AddChidren(editRoom);
                HomePage.Instance.PageIndex += 1;
                editRoom.temperDevice = this.temperDevice;
                editRoom.humidDevice = this.humidDevice;
                editRoom.Show(room);
                editRoom.action += () =>
                {
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs
@@ -237,7 +237,7 @@
                        //0 移除失败
                        else if (removeSceneAllData.removeSceneData.Result == 0)
                        {
                            CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
                            return;
                        }
                        //2 没有该场景
@@ -246,7 +246,7 @@
                            room.RemoveScene(scene);
                            //RefreshBodyView();
                            RemoveFromParent();
                            CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneIsNull);
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsNull));
                            return;
                        }
                    };
@@ -417,7 +417,7 @@
                {
                    return;
                }
                CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ControlSceneFail);
                CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.ControlSceneFail));
            }
            scene.RemainTime = scene.SceneDelayTime;
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs
@@ -279,7 +279,7 @@
                {
                    return;
                }
                CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ControlSceneFail);
                CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.ControlSceneFail));
            }
            scene.RemainTime = scene.SceneDelayTime;
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs
@@ -27,7 +27,7 @@
        /// <summary>
        /// SeekBar
        /// </summary>
        public HorizontalSeekBar SeekBar;
        public DiyImageSeekBar SeekBar;
        /// <summary>
        /// SeekBarTitle
        /// </summary>
@@ -104,17 +104,20 @@
            };
            AddChidren(ClickButton);
            SeekBar = new HorizontalSeekBar()
            SeekBar = new DiyImageSeekBar()
            {
                X = Application.GetRealWidth(81),
                Y = Application.GetRealHeight(200),
                Width = Application.GetRealWidth(919),
                Height = Application.GetRealHeight(127),
                BackgroundColor = ZigbeeColor.Current.GXCSeekBarBackground,
                ProgressColor = ZigbeeColor.Current.GXCProgressColor,
                ThumbColor = ZigbeeColor.Current.GXCBackgroundColor,
                Max = MaxLevel,
                Progress = MaxLevel
                ProgressBarColor = ZigbeeColor.Current.GXCProgressColor,
                MaxValue = MaxLevel,
                Progress = MaxLevel,
                IsProgressTextShow = false,
                IsClickable = true,
                ThumbImageHeight=Application.GetMinRealAverage(80),
                SeekBarViewHeight=Application.GetRealHeight(6),
                ThumbImagePath="Item/SeekBarIcon.png"
            };
            AddChidren(SeekBar);
@@ -126,7 +129,8 @@
                Gravity = Gravity.CenterHorizontal,
                Text = $"{(int)(SeekBar.Progress * 1.0 / MaxLevel * 100)} %",
                TextColor = ZigbeeColor.Current.GXCTextGrayColor,
                TextSize=12
                TextSize = 12,
                IsBold = true
            };
            AddChidren(SeekBarTitle);
@@ -166,11 +170,11 @@
            SelectBtn.Visible = statu;
            if(statu)
            {
                SetProgress(100);
                SetSeekBarProgress(SeekBar.Progress == 0 ? MaxLevel : SeekBar.Progress);
            }
            else
            {
                SetProgress(0);
                SetSeekBarProgress(0);
            }
        }
@@ -195,7 +199,7 @@
        /// SetProgress
        /// </summary>
        /// <param name="progress"></param>
        public void SetProgress(int progress)
        public void SetSeekBarProgress(int progress)
        {
            SeekBar.Progress = progress;
            SetSeekBarTitle();
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneRow.cs
@@ -83,7 +83,7 @@
            NameBtn = new Button()
            {
                X = Application.GetRealWidth(173),
                Width = Application.GetRealWidth(500),
                Width = Application.GetRealWidth(600),
                Height = Application.GetRealHeight(80),
                Gravity = Gravity.CenterVertical,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs
@@ -7,21 +7,14 @@
    public class SelectZone
    {
        public Action<Common.Room> ZoneAction;
        private UIPickerView pickView;
        private List<string> floorList = new List<string> { };
        private List<string> roomList = new List<string> { };
        private List<string> roomIdList = new List<string> { };
        /// <summary>
        /// curRoom
        /// </summary>
        private Common.Room curRoom;
        public SelectZone()
        {
        }
        /// <summary>
        /// 标题
        /// </summary>
        public string title = Language.StringByID(R.MyInternationalizationString.BelongZone);
        /// <summary>
        /// Init
        /// </summary>
@@ -37,10 +30,11 @@
            {
                foreach (var floor in Config.Instance.Home.FloorDics)
                {
                    floorIds.Add(floor.Key);
                    floorNames.Add(floor.Value);
                    if (Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count > 0)
                    {
                        floorIds.Add(floor.Key);
                        floorNames.Add(floor.Value);
                        roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key));
                        rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key));
                    }
@@ -49,8 +43,7 @@
                {
                    curRoom = rooms[index1][index2];
                    ZoneAction?.Invoke(curRoom);
                    //RemoveFromParent();
                }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor),
                }, 0, 0, title,
               Language.StringByID(R.MyInternationalizationString.Confrim),
               Language.StringByID(R.MyInternationalizationString.Cancel));
            }
@@ -70,47 +63,10 @@
                {
                    curRoom = rs[index1];
                    ZoneAction?.Invoke(curRoom);
                    //RemoveFromParent();
                }, 0, Language.StringByID(R.MyInternationalizationString.AddTo),
                }, 0, title,
               Language.StringByID(R.MyInternationalizationString.Confrim),
               Language.StringByID(R.MyInternationalizationString.Cancel));
            }
            foreach (var floor in Config.Instance.Home.FloorDics)
            {
                floorList.Add(floor.Value);
            }
            foreach (var room in Shared.Common.Room.Lists)
            {
                if(room.IsLove)
                {
                    continue;
                }
                roomList.Add(room.Name);
                roomIdList.Add(room.Id);
            }
        }
        /// <summary>
        /// Close
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="mouseEventArgs"></param>
        private void Close(object sender, MouseEventArgs mouseEventArgs)
        {
            //RemoveFromParent();
        }
        /// <summary>
        /// Confrim_MouseEvent
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="mouseEventArgs"></param>
        private void Confrim_MouseEvent(object sender, MouseEventArgs mouseEventArgs)
        {
            //ZoneAction?.Invoke(curRoom);
            //RemoveFromParent();
        }
    }
}
ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -13,7 +13,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI,Common.Room> action;
        /// <summary>
        /// 收藏按钮
@@ -246,8 +246,8 @@
        {
            UserView.HomePage.Instance.ScrollEnabled = true;
            ZigBee.Device.ZbGateway.StatusList.Remove(this);
            //action();
            //action = null;
            action(device,room);
            action = null;
            RemoveUpdateControlDeviceStatuAction();
            if (IsDrawerLockMode)
            {
@@ -298,8 +298,7 @@
                }
            }
            var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (de == null)
            if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
            {
                collectionBtn.IsSelected = false;
            }
@@ -654,9 +653,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev,curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
@@ -8,7 +8,7 @@
namespace Shared.Phone.Device.Light
{
    /// <summary>
    /// 灯光控制界面
    /// 开关
    /// </summary>
    public class AirSwitchControl : FrameLayout, ZigBee.Common.IStatus
    {
@@ -20,7 +20,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI, Common.Room> action;
        /// <summary>
        /// The light image.
@@ -62,12 +62,19 @@
        private FrameLayout bodyFrameLayout;
        private Button StatuBtn;
        /// <summary>
        /// OnBtn
        /// </summary>
        private Button OnBtn;
        /// <summary>
        /// OffBtn
        /// </summary>
        private Button OffBtn;
        /// <summary>
        /// IsDrawerLockMode
        /// </summary>
        public bool IsDrawerLockMode;
        #endregion
        #region ◆ 接口__________________________
@@ -129,7 +136,7 @@
                        {
                            if (common.DeviceStatusReport.CluterID == 6)
                            {
                                var light = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
                                var light = deviceUI.CommonDevice as AirSwitch;
                                light.DeviceStatusReport = common.DeviceStatusReport;
                                //记录、更新状态
                                if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
@@ -137,8 +144,22 @@
                                    return;
                                }
                                light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
                                deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
                                StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}";
                                if (device.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
                                {
                                    SetONOFFStatu(light.OnOffStatus == 1);
                                }
                                else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
                                {
                                    deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
                                }
                                else
                                {
                                    deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
                                }
                                light.LastDateTime = DateTime.Now;
                            }
                        }
@@ -151,7 +172,30 @@
            }
            else if (typeTag == "OnlineStatusChange")
            {
                Application.RunOnMainThread(() =>
                {
                    try
                    {
                        var deviceUI = device;
                        //设备为空
                        if (deviceUI.CommonDevice == null)
                        {
                            return;
                        }
                        //是否为当前设备
                        if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
                        {
                            return;
                        }
                        deviceUI.CommonDevice.IsOnline = common.IsOnline;
                        //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
                        deviceUI.CommonDevice.LastDateTime = DateTime.Now;
                    }
                    catch (Exception ex)
                    {
                        System.Console.WriteLine($"Error:{ex.Message}");
                    }
                });
            }
        }
        #endregion
@@ -163,8 +207,8 @@
        public override void RemoveFromParent()
        {
            ZbGateway.StatusList.Remove(this);
            //action();
            //action = null;
            action(device, room);
            action = null;
            RemoveUpdateControlDeviceStatuAction();
            if (IsDrawerLockMode)
            {
@@ -197,7 +241,7 @@
            AddBodyView(device);
            var light = dev.CommonDevice as ZigBee.Device.AirSwitch;
            var light = dev.CommonDevice as AirSwitch;
            //补上非远程
            if (light.Gateway == null)
            {
@@ -219,8 +263,7 @@
                }
            }
            var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (de == null)
            if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
            {
                collectionBtn.IsSelected = false;
            }
@@ -308,7 +351,7 @@
                Text = device.CommonDevice.DeviceEpointName,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                TextSize = 15,
                IsBold=true
                IsBold = true
            };
            itemView.AddChidren(deviceNameBtn);
@@ -323,30 +366,6 @@
                TextSize = 10
            };
            itemView.AddChidren(StatuBtn);
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(389),
                Width = Application.GetMinRealAverage(377),
                Height = Application.GetMinRealAverage(435),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/DeskLamp.png",
                SelectedImagePath = "Light/DeskLampSelected.png",
                IsSelected = (device.CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(deviceIMG);
            switchBtn = new Button()
            {
                Y = Application.GetRealHeight(996),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Item/Switch.png",
                SelectedImagePath = "Item/SwitchSelected.png",
                IsSelected = (device.CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(switchBtn);
            var roomBG = new Button
            {
@@ -387,6 +406,138 @@
                TextSize = 12
            };
            itemView.AddChidren(roomName);
            AddByFunctionType(itemView);
        }
        /// <summary>
        /// AddByFunctionType
        /// </summary>
        private void AddByFunctionType(FrameLayout itemView)
        {
            if (device.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
            {
                AddOnOff(itemView);
            }
            else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
            {
                AddPlug(itemView);
            }
            else
            {
                AddLight(itemView);
            }
        }
        /// <summary>
        /// AddOnOff
        /// </summary>
        private void AddOnOff(FrameLayout itemView)
        {
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(340),
                Width = Application.GetMinRealAverage(579),
                Height = Application.GetMinRealAverage(579),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/OnOff.png",
            };
            itemView.AddChidren(deviceIMG);
            OffBtn = new Button
            {
                X = Application.GetRealWidth(294),
                Y = Application.GetRealHeight(588),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                UnSelectedImagePath = "Light/OFF.png",
                SelectedImagePath = "Light/OFFSelected.png",
                IsSelected = (device.CommonDevice as AirSwitch).OnOffStatus == 0
            };
            itemView.AddChidren(OffBtn);
            OnBtn = new Button
            {
                X = Application.GetRealWidth(590),
                Y = Application.GetRealHeight(588),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                UnSelectedImagePath = "Light/ON.png",
                SelectedImagePath = "Light/ONSelected.png",
                IsSelected = (device.CommonDevice as AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(OnBtn);
            OnBtn.MouseUpEventHandler += ON;
            OffBtn.MouseUpEventHandler += OFF;
        }
        /// <summary>
        /// light
        /// </summary>
        /// <param name="itemView"></param>
        private void AddLight(FrameLayout itemView)
        {
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(389),
                Width = Application.GetMinRealAverage(377),
                Height = Application.GetMinRealAverage(435),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/DeskLamp.png",
                SelectedImagePath = "Light/DeskLampSelected.png",
                IsSelected = (device.CommonDevice as AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(deviceIMG);
            switchBtn = new Button()
            {
                Y = Application.GetRealHeight(996),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Item/Switch.png",
                SelectedImagePath = "Item/SwitchSelected.png",
                IsSelected = (device.CommonDevice as AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(switchBtn);
            switchBtn.MouseUpEventHandler += Switch;
            deviceIMG.MouseUpEventHandler += Switch;
        }
        /// <summary>
        /// plug
        /// </summary>
        /// <param name="itemView"></param>
        private void AddPlug(FrameLayout itemView)
        {
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(344),
                Width = Application.GetMinRealAverage(567),
                Height = Application.GetMinRealAverage(567),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/Plug.png",
                SelectedImagePath = "Light/PlugSelected.png",
                IsSelected = (device.CommonDevice as AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(deviceIMG);
            switchBtn = new Button()
            {
                Y = Application.GetRealHeight(996),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Item/Switch.png",
                SelectedImagePath = "Item/SwitchSelected.png",
                IsSelected = (device.CommonDevice as AirSwitch).OnOffStatus == 1
            };
            itemView.AddChidren(switchBtn);
            switchBtn.MouseUpEventHandler += Switch;
            deviceIMG.MouseUpEventHandler += Switch;
        }
        #endregion
@@ -397,8 +548,6 @@
        /// </summary>
        private void BindEvent()
        {
            switchBtn.MouseUpEventHandler += Switch;
            deviceIMG.MouseUpEventHandler += Switch;
            collectionBtn.MouseUpEventHandler += Collection;
        }
@@ -418,13 +567,14 @@
            switchBtn.IsSelected = !switchBtn.IsSelected;
            deviceIMG.IsSelected = !deviceIMG.IsSelected;
            StatuBtn.Text = deviceIMG.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Open)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
            if (switchBtn.IsSelected == true)
            {
                (device.CommonDevice as ZigBee.Device.AirSwitch).SwitchControl(1);
                (device.CommonDevice as AirSwitch).SwitchControl(1);
            }
            else
            {
                (device.CommonDevice as ZigBee.Device.AirSwitch).SwitchControl(0);
                (device.CommonDevice as AirSwitch).SwitchControl(0);
            }
            //控制延时回调
            DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
@@ -441,6 +591,73 @@
            });
        }
        /// <summary>
        /// ON
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        private void ON(object sender, MouseEventArgs eventArgs)
        {
            SetONOFFStatu(true);
            (device.CommonDevice as AirSwitch).SwitchControl(1);
            //控制延时回调
            zbGateway.ReportAction += UpdateDeviceControllStatu;
            DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
            {
                if (Parent == null)
                {
                    return;
                }
                RemoveUpdateControlDeviceStatuAction();
                if (sendedControlCommand == false)
                {
                    DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
                }
            });
        }
        /// <summary>
        /// OFF
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        private void OFF(object sender, MouseEventArgs eventArgs)
        {
            SetONOFFStatu(false);
            (device.CommonDevice as AirSwitch).SwitchControl(0);
            //控制延时回调
            zbGateway.ReportAction += UpdateDeviceControllStatu;
            DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
            {
                if (Parent == null)
                {
                    return;
                }
                RemoveUpdateControlDeviceStatuAction();
                if (sendedControlCommand == false)
                {
                    DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
                }
            });
        }
        /// <summary>
        /// SetONOFFStatu
        /// </summary>
        /// <param name="statu"></param>
        private void SetONOFFStatu(bool statu)
        {
            if (statu)
            {
                OnBtn.IsSelected = true;
                OffBtn.IsSelected = false;
            }
            else
            {
                OnBtn.IsSelected = false;
                OffBtn.IsSelected = true;
            }
            StatuBtn.Text = statu ? $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Open)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
        }
        #endregion
@@ -457,9 +674,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev, curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
@@ -473,6 +690,7 @@
        /// <param name="e">E.</param>
        private void Collection(object sender, MouseEventArgs e)
        {
            //collection
            if ((sender as Button).IsSelected)
            {
                Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName);
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -13,7 +13,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI, Common.Room> action;
        ///// <summary>
        ///// The top view.
        ///// </summary>
@@ -139,7 +139,6 @@
                            {
                                dimmableLight = deviceUI.CommonDevice as DimmableLight;
                                dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
                                //记录、更新状态
                                if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
                                {
                                    return;
@@ -151,16 +150,13 @@
                                if (switchBtn.IsSelected == true)
                                {
                                    levelSeekBar.IsClickable = true;
                                    levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
                                    //levelSeekBar.Progress = 100;
                                    levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
                                }
                                else
                                {
                                    levelSeekBar.IsClickable = false;
                                    levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
                                    //levelSeekBar.Progress = 0;
                                    levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
                                }
                                //change color
                                dimmableLight.LastDateTime = DateTime.Now;
                            }
                            //亮度
@@ -181,7 +177,6 @@
                                        dimmableLight.LastDateTime = DateTime.Now;
                                        levelSeekBar.Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100);
                                        StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
                                        break;
                                }
                            }
@@ -211,8 +206,8 @@
        {
            ZbGateway.StatusList.Remove(this);
            UserView.HomePage.Instance.ScrollEnabled = true;
            //action();
            //action = null;
            action(device, room);
            action = null;
            if (IsDrawerLockMode)
            {
                CommonPage.Instance.IsDrawerLockMode = false;
@@ -314,9 +309,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev, curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
@@ -405,7 +400,7 @@
                WavePadding = Application.GetRealWidth(8),
                MaxValue=100,
                Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100),
                WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor,
                CornerRadius= Application.GetRealHeight(58)
            };
@@ -414,12 +409,12 @@
            if (dimmableLight.OnOffStatus == 1)
            {
                levelSeekBar.IsClickable = true;
                levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
                levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
            }
            else
            {
                levelSeekBar.IsClickable = false;
                levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
                levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
            }
            levelSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
@@ -433,6 +428,7 @@
            {
                ProgressBtn.Visible = false;
                levelSeekBar.IsProgressTextShow = true;
                dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
            };
            levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
@@ -441,12 +437,9 @@
                OnProgressButtonMove(e2);
                //判断是否300ms屏蔽
                if (levelSeekBar.IsProgressChangeDelay()) return;
                dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
                //if (levelSeekBar.IsProgressChangeDelay()) return;
                //dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
            };
            InitProgressBtn(itemView);
            InitProgressBtn(itemView);
@@ -525,7 +518,10 @@
                Height = Application.GetMinReal(104),
                UnSelectedImagePath = "Item/ProgressBubbles.png",
                Visible = false,
                Gravity = Gravity.CenterHorizontal
                Gravity = Gravity.CenterHorizontal,
                TextSize = 14,
                IsBold = true,
                TextColor = ZigbeeColor.Current.GXCTextWhiteColor
            };
            layout.AddChidren(ProgressBtn);
        }
@@ -559,13 +555,13 @@
            {
                dimmableLight.SwitchControl(1);
                levelSeekBar.IsClickable = true;
                levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
                levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
            }
            else
            {
                dimmableLight.SwitchControl(0);
                levelSeekBar.IsClickable = false;
                levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
                levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
            }
        }
@@ -578,8 +574,7 @@
        /// </summary>
        private void InitCollection()
        {
            var dev = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (dev == null)
            if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
            {
                collectionBtn.IsSelected = false;
            }
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
@@ -20,7 +20,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI, Common.Room> action;
        /// <summary>
        /// The light image.
@@ -185,8 +185,8 @@
        public override void RemoveFromParent()
        {
            ZbGateway.StatusList.Remove(this);
            //action();
            //action = null;
            action(device, room);
            action = null;
            if (IsDrawerLockMode)
            {
                CommonPage.Instance.IsDrawerLockMode = false;
@@ -241,8 +241,7 @@
                }
            }
            var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (de == null)
            if(Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
            {
                collectionBtn.IsSelected = false;
            }
@@ -482,9 +481,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev, curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
@@ -20,7 +20,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI, Common.Room> action;
        /// <summary>
        /// The light image.
@@ -144,8 +144,22 @@
                                    return;
                                }
                                light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
                                SetONOFFStatu(light.OnOffStatus == 1);
                                StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}";
                                if (device.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
                                {
                                    SetONOFFStatu(light.OnOffStatus == 1);
                                }
                                else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
                                {
                                    deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
                                }
                                else
                                {
                                    deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
                                }
                                light.LastDateTime = DateTime.Now;
                            }
                        }
@@ -193,8 +207,8 @@
        public override void RemoveFromParent()
        {
            ZbGateway.StatusList.Remove(this);
            //action();
            //action = null;
            action(device, room);
            action = null;
            RemoveUpdateControlDeviceStatuAction();
            if (IsDrawerLockMode)
            {
@@ -249,8 +263,7 @@
                }
            }
            var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (de == null)
            if(Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
            {
                collectionBtn.IsSelected = false;
            }
@@ -354,40 +367,6 @@
            };
            itemView.AddChidren(StatuBtn);
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(340),
                Width = Application.GetMinRealAverage(579),
                Height = Application.GetMinRealAverage(579),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/OnOff.png",
            };
            itemView.AddChidren(deviceIMG);
            OffBtn = new Button
            {
                X = Application.GetRealWidth(294),
                Y = Application.GetRealHeight(588),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                UnSelectedImagePath = "Light/OFF.png",
                SelectedImagePath = "Light/OFFSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 0
            };
            itemView.AddChidren(OffBtn);
            OnBtn = new Button
            {
                X = Application.GetRealWidth(590),
                Y = Application.GetRealHeight(588),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                UnSelectedImagePath = "Light/ON.png",
                SelectedImagePath = "Light/ONSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 1
            };
            itemView.AddChidren(OnBtn);
            var roomBG = new Button
            {
                Y = Application.GetRealHeight(1178 - 50),
@@ -427,6 +406,138 @@
                TextSize = 12
            };
            itemView.AddChidren(roomName);
            AddByFunctionType(itemView);
        }
        /// <summary>
        /// AddByFunctionType
        /// </summary>
        private void AddByFunctionType(FrameLayout itemView)
        {
            if(device.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
            {
                AddOnOff(itemView);
            }
            else if(device.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
            {
                AddPlug(itemView);
            }
            else
            {
                AddLight(itemView);
            }
        }
        /// <summary>
        /// AddOnOff
        /// </summary>
        private void AddOnOff(FrameLayout itemView)
        {
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(340),
                Width = Application.GetMinRealAverage(579),
                Height = Application.GetMinRealAverage(579),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/OnOff.png",
            };
            itemView.AddChidren(deviceIMG);
            OffBtn = new Button
            {
                X = Application.GetRealWidth(294),
                Y = Application.GetRealHeight(588),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                UnSelectedImagePath = "Light/OFF.png",
                SelectedImagePath = "Light/OFFSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 0
            };
            itemView.AddChidren(OffBtn);
            OnBtn = new Button
            {
                X = Application.GetRealWidth(590),
                Y = Application.GetRealHeight(588),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                UnSelectedImagePath = "Light/ON.png",
                SelectedImagePath = "Light/ONSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 1
            };
            itemView.AddChidren(OnBtn);
            OnBtn.MouseUpEventHandler += ON;
            OffBtn.MouseUpEventHandler += OFF;
        }
        /// <summary>
        /// light
        /// </summary>
        /// <param name="itemView"></param>
        private void AddLight(FrameLayout itemView)
        {
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(389),
                Width = Application.GetMinRealAverage(377),
                Height = Application.GetMinRealAverage(435),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/DeskLamp.png",
                SelectedImagePath = "Light/DeskLampSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 1
            };
            itemView.AddChidren(deviceIMG);
            switchBtn = new Button()
            {
                Y = Application.GetRealHeight(996),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Item/Switch.png",
                SelectedImagePath = "Item/SwitchSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 1
            };
            itemView.AddChidren(switchBtn);
            switchBtn.MouseUpEventHandler += Switch;
            deviceIMG.MouseUpEventHandler += Switch;
        }
        /// <summary>
        /// plug
        /// </summary>
        /// <param name="itemView"></param>
        private void AddPlug(FrameLayout itemView)
        {
            deviceIMG = new Button()
            {
                Y = Application.GetRealHeight(344),
                Width = Application.GetMinRealAverage(567),
                Height = Application.GetMinRealAverage(567),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Light/Plug.png",
                SelectedImagePath = "Light/PlugSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 1
            };
            itemView.AddChidren(deviceIMG);
            switchBtn = new Button()
            {
                Y = Application.GetRealHeight(996),
                Width = Application.GetMinRealAverage(81),
                Height = Application.GetMinRealAverage(81),
                Gravity = Gravity.CenterHorizontal,
                UnSelectedImagePath = "Item/Switch.png",
                SelectedImagePath = "Item/SwitchSelected.png",
                IsSelected = (device.CommonDevice as ToggleLight).OnOffStatus == 1
            };
            itemView.AddChidren(switchBtn);
            switchBtn.MouseUpEventHandler += Switch;
            deviceIMG.MouseUpEventHandler += Switch;
        }
        #endregion
@@ -437,8 +548,6 @@
        /// </summary>
        private void BindEvent()
        {
            OnBtn.MouseUpEventHandler += ON;
            OffBtn.MouseUpEventHandler += OFF;
            collectionBtn.MouseUpEventHandler += Collection;
        }
@@ -451,35 +560,36 @@
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="eventArgs">Event arguments.</param>
        //private void Switch(object sender, MouseEventArgs eventArgs)
        //{
        //    sendedControlCommand = false;
        //    zbGateway.ReportAction += UpdateDeviceControllStatu;
        //    switchBtn.IsSelected = !switchBtn.IsSelected;
        //    deviceIMG.IsSelected = !deviceIMG.IsSelected;
        //    StatuBtn.Text = CommonFormResouce.GetSwitchStatu(deviceIMG.IsSelected);
        //    if (switchBtn.IsSelected == true)
        //    {
        //        (device.CommonDevice as ToggleLight).SwitchControl(1);
        //    }
        //    else
        //    {
        //        (device.CommonDevice as ToggleLight).SwitchControl(0);
        //    }
        //    //控制延时回调
        //    DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
        //    {
        //        if (Parent == null)
        //        {
        //            return;
        //        }
        //        RemoveUpdateControlDeviceStatuAction();
        //        if (sendedControlCommand == false)
        //        {
        //            DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
        //        }
        //    });
        //}
        private void Switch(object sender, MouseEventArgs eventArgs)
        {
            sendedControlCommand = false;
            zbGateway.ReportAction += UpdateDeviceControllStatu;
            switchBtn.IsSelected = !switchBtn.IsSelected;
            deviceIMG.IsSelected = !deviceIMG.IsSelected;
            StatuBtn.Text = deviceIMG.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Open)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
            if (switchBtn.IsSelected == true)
            {
                (device.CommonDevice as ToggleLight).SwitchControl(1);
            }
            else
            {
                (device.CommonDevice as ToggleLight).SwitchControl(0);
            }
            //控制延时回调
            DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
            {
                if (Parent == null)
                {
                    return;
                }
                RemoveUpdateControlDeviceStatuAction();
                if (sendedControlCommand == false)
                {
                    DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
                }
            });
        }
        /// <summary>
        /// ON
@@ -564,9 +674,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev, curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
@@ -21,7 +21,7 @@
        /// <summary>
        /// The action.
        /// </summary>
        public Action action;
        public Action<DeviceUI, Common.Room> action;
        /// <summary>
        /// The light image.
@@ -186,8 +186,8 @@
        public override void RemoveFromParent()
        {
            ZbGateway.StatusList.Remove(this);
            //action();
            //action = null;
            action(device, room);
            action = null;
            RemoveUpdateControlDeviceStatuAction();
            if (IsDrawerLockMode)
            {
@@ -242,8 +242,7 @@
                }
            }
            var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
            if (de == null)
            if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
            {
                collectionBtn.IsSelected = false;
            }
@@ -480,9 +479,9 @@
            UserView.HomePage.Instance.AddChidren(detailInfo);
            UserView.HomePage.Instance.PageIndex += 1;
            detailInfo.Show(device, room);
            detailInfo.EditAction = (d,r) =>
            detailInfo.EditAction += (curDev, curRoom) =>
            {
                Show(device, room);
                Show(curDev, curRoom);
            };
        }
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -46,9 +46,9 @@
        /// </summary>
        public int OldIconPathType;
        CommonDevice temperDevice;
        public CommonDevice temperDevice;
        CommonDevice humidDevice;
        public CommonDevice humidDevice;
        DeviceInfoRow temperatureRow;
@@ -107,7 +107,7 @@
                        //是否为当前设备
                        if ((temperDevice?.DeviceEpoint != common.DeviceEpoint || temperDevice?.DeviceAddr != common.DeviceAddr) && (humidDevice?.DeviceEpoint != common.DeviceEpoint || humidDevice?.DeviceAddr != common.DeviceAddr))
                        {
                            //return;
                            return;
                        }
                        //if (common.Type == DeviceType.TemperatureSensor)
@@ -251,7 +251,6 @@
            };
            bodyFrameLayout.AddChidren(backGround1);
            backGround = new ImageView()
            {
                Y = Application.GetRealHeight(60),
@@ -350,6 +349,7 @@
                        return;
                    }
                    room.TemperatrueDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
                    temperDevice=Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
                    temperatureRow.SetTitle(R.MyInternationalizationString.Getting);
                    //发送获取温度的命令
                    ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(selectTemp);
@@ -359,8 +359,8 @@
            {
                temperatureRow.SetTitle(room.Temperatrue == 0 ? "--℃" : $"{room.Temperatrue}℃");
                //发送获取温度的命令
                var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
                ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev);
                temperDevice = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
                ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(temperDevice);
            }
            else
            {
@@ -387,6 +387,7 @@
                        return;
                    }
                    room.HumidityDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
                    humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
                    humidityRow.SetTitle(R.MyInternationalizationString.Getting);
                    //发送获取湿度的命令
@@ -397,8 +398,8 @@
            {
                humidityRow.SetTitle(room.Humidity == 0 ? "--%" : $"{room.Humidity}%");
                //发送获取湿度的命令
                var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
                ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(dev);
                humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
                ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(humidDevice);
            }
            else
            {
@@ -408,7 +409,7 @@
            if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove)
            {
                temperatureRow.Y = Application.GetRealHeight(308);
                humidityRow.Y= Application.GetRealHeight(446);
                humidityRow.Y = Application.GetRealHeight(446);
            }
            var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127);
@@ -553,7 +554,7 @@
                //通过相机拍照裁剪
                CropImage.TakePicture((imagePath) =>
                {
                    if (string.IsNullOrEmpty(imagePath) == true)
                    if (string.IsNullOrEmpty(imagePath))
                    {
                        return;
                    }
@@ -578,7 +579,7 @@
                //从相册选择图片裁剪
                CropImage.SelectPicture((imagePath) =>
                {
                    if (string.IsNullOrEmpty(imagePath) == true)
                    if (string.IsNullOrEmpty(imagePath))
                    {
                        return;
                    }
ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs
@@ -91,10 +91,10 @@
        /// </summary>
        public void Show()
        {
            RemoveAll();
            InitData();
            AddTop();
            AddBodyView();
        }
        /// <summary>
@@ -468,9 +468,9 @@
            add.MouseUpEventHandler += (sender, e) =>
            {
                var selectZone = new SelectZone();
                //AddChidren(selectZone);
                selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo);
                selectZone.Init();
                selectZone.ZoneAction = (r) =>
                selectZone.ZoneAction += (r) =>
                {
                    foreach (var d in selectedList)
                    {
@@ -699,9 +699,9 @@
                add.MouseUpEventHandler += (sender, e) =>
                {
                    var selectZone = new SelectZone();
                    //CommonPage.Instance.AddChidren(selectZone);
                    selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo);
                    selectZone.Init();
                    selectZone.ZoneAction = (r) =>
                    selectZone.ZoneAction += (r) =>
                    {
                        foreach (var s in selectedList)
                        {
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs
@@ -56,6 +56,10 @@
        /// <summary>
        /// 简约面板震动功能
        /// </summary>
        A简约面板震动功能 = 12
        A简约面板震动功能 = 12,
        /// <summary>
        /// 空调摆风功能
        /// </summary>
        A空调摆风功能 = 13,
    }
}
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
old mode 100644 new mode 100755
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetySensorStatuControl.cs
@@ -119,6 +119,23 @@
            {
                return;
            }
            string strMsg = reportInfo.AlarmMsg;
            if (reportInfo.DemolishmenMsg != null)
            {
                //被拆报警
                strMsg = reportInfo.DemolishmenMsg;
            }
            else if (reportInfo.BatteryMsg != null)
            {
                //电池报警
                strMsg = reportInfo.BatteryMsg;
            }
            if (strMsg == null || strMsg == string.Empty)
            {
                //不是在册的报警消息
                return;
            }
            //在线状态的控件隐藏
            btnOnline.Visible = false;
@@ -138,18 +155,7 @@
                btnMsg.Y = Application.GetRealHeight(141);
                this.AddChidren(btnMsg);
            }
            if (reportInfo.DemolishmenMsg != null)
            {
                btnMsg.Text = reportInfo.DemolishmenMsg;
            }
            else if (reportInfo.BatteryMsg != null)
            {
                btnMsg.Text = reportInfo.BatteryMsg;
            }
            else
            {
                btnMsg.Text = reportInfo.AlarmMsg;
            }
            btnMsg.Text = strMsg;
        }
        #endregion
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
@@ -75,6 +75,11 @@
                {
                    if (dataInfo.PageData[i].IsReading == false)
                    {
                        if (dataInfo.PageData[i].Topic == "/DoorLock/DoorLockOperatingEventNotificationCommand")
                        {
                            //暂时不处理这个主题
                            continue;
                        }
                        ControlCommonResourse.HadNewMessage = true;
                        Application.RunOnMainThread(() =>
                        {
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
@@ -17,7 +17,7 @@
        public ScenePictrueControl()
        {
            this.UseClickStatu = false;
            this.Height = Application.GetRealHeight(470);
            this.Height = Application.GetRealHeight(420);
        }
        /// <summary>
@@ -30,7 +30,7 @@
            var btnPic = new ImageView();
            btnPic.X = Application.GetRealWidth(179);
            btnPic.Width = Application.GetRealWidth(844);
            btnPic.Height = Application.GetRealHeight(420);
            btnPic.Height = Application.GetRealHeight(397);
            if (sceneUI.IconPathType == 0)
            {
                btnPic.ImagePath = sceneUI.IconPath;
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlACZbGatewayUpdateLogic.cs
@@ -212,7 +212,7 @@
            this.zbGateway.ReportAction += receiveAction;
            //读取空调模块版本
            var result = await deviceAc.ReadACFirewareVersionAsync();
            var result = await HdlDeviceAirConditionerLogic.Current.ReadACFirewareVersionAsync(deviceAc);
            if (result == null || result.readACFirewareVersionResponData == null || result.readACFirewareVersionResponData.Status != 0)
            {
                //获取空调模块版本失败
@@ -222,11 +222,11 @@
                this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                this.zbGateway.ReportAction -= receiveAction;
                //发送失败给设备
                deviceAc.SendFinishAsync(1);
                HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 1);
                return;
            }
            //发送升级通知
            var result2 = await deviceAc.UpggradeACNotificationAsync(result.readACFirewareVersionResponData.FirewareVersion, this.deviceFirmwareByte.Length);
            var result2 = await HdlDeviceAirConditionerLogic.Current.UpggradeACNotificationAsync(deviceAc, result.readACFirewareVersionResponData.FirewareVersion, this.deviceFirmwareByte.Length);
            if (result2.responseData == null)
            {
                //发送升级命令失败
@@ -236,7 +236,7 @@
                this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                this.zbGateway.ReportAction -= receiveAction;
                //发送失败给设备
                deviceAc.SendFinishAsync(1);
                HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 1);
                return;
            }
            else if (result2.responseData.status == 1)
@@ -248,7 +248,7 @@
                this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                this.zbGateway.ReportAction -= receiveAction;
                //发送失败给设备
                deviceAc.SendFinishAsync(1);
                HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 1);
                return;
            }
            else if (result2.responseData.status != 0)
@@ -260,7 +260,7 @@
                this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                this.zbGateway.ReportAction -= receiveAction;
                //发送失败给设备
                deviceAc.SendFinishAsync(1);
                HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 1);
                return;
            }
@@ -278,7 +278,7 @@
                    this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                    this.zbGateway.ReportAction -= receiveAction;
                    //发送失败给设备
                    deviceAc.SendFinishAsync(1);
                    HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 1);
                    return;
                }
                await System.Threading.Tasks.Task.Delay(1000);
@@ -298,7 +298,7 @@
        /// <summary>
        /// 执行设备升级操作
        /// </summary>
        private async void DoSetUpdateDevice(string i_offset,int i_dataLength)
        private async void DoSetUpdateDevice(string i_offset, int i_dataLength)
        {
            this.UpdateStatu = UpdateStatuMode.DeviceUpdateReady;
            //设备正在升级…
@@ -372,7 +372,7 @@
                        this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                        this.zbGateway.ReportAction -= receiveAction;
                        //发送失败给设备
                        deviceAc.SendFinishAsync(1);
                        HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 1);
                        return;
                    }
                    await System.Threading.Tasks.Task.Delay(50);
@@ -398,9 +398,9 @@
                    }
                }
                //发送透传数据
                var sendData = new AC.SendUpgradeData() { dataLength = i_dataLength, offset = i_offset };
                var sendData = new HdlDeviceAirConditionerLogic.SendUpgradeData() { dataLength = i_dataLength, offset = i_offset };
                sendData.databytes = listData.ToArray();
                deviceAc.UpgradeAsync(sendData);
                HdlDeviceAirConditionerLogic.Current.UpgradeAsync(deviceAc, sendData);
            }
            this.zbGateway.ReportAction -= receiveAction;
@@ -421,7 +421,7 @@
            this.UpdateStatuChangedEvent?.Invoke(0, Language.StringByID(R.MyInternationalizationString.uSendingFinishUpdateComand));
            //发送成功命令给设备
            deviceAc.SendFinishAsync(0);
            HdlDeviceAirConditionerLogic.Current.SendFinishAsync(deviceAc, 0);
            //等个两秒钟吧
            await System.Threading.Tasks.Task.Delay(2000);
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
@@ -151,6 +152,47 @@
        #endregion
        #region ■ 设置启用空调的摆风功能_____________
        /// <summary>
        /// 设置启用空调的摆风功能
        /// </summary>
        /// <param name="device">空调对象</param>
        /// <param name="data">从二进制转换的十进制值</param>
        /// <returns></returns>
        public async Task<bool> SetUseAcSwingFunctionStatu(AC device, int data)
        {
            var result = await HdlDeviceAttributeLogic.Current.WriteDeviceAttribute(device, 514, 4097, 25, data.ToString());
            //检测网关返回的共通错误状态码
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowTipMsg(error);
                return false;
            }
            if (result == null || result.setWritableValueResponData == null)
            {
                //设置空调摆风失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetAirConditionerSwingFunctionFail);
                //拼接上【网关回复超时】的Msg
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg);
                return false;
            }
            if (result.setWritableValueResponData.Status != 0)
            {
                //设置空调摆风失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetAirConditionerSwingFunctionFail);
                this.ShowTipMsg(msg);
                return false;
            }
            await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.A空调摆风功能, data);
            return true;
        }
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
@@ -180,5 +222,597 @@
        }
        #endregion
        #region ■ 升级空调第三方模块的接口___________
        #region 读取IRACC模块固件版本(APP -> Zigbee MCU)
        ///<summary >
        ///读取IRACC模块固件版本
        /// </summary>
        public async System.Threading.Tasks.Task<ReadACFirewareVersionResponAllData> ReadACFirewareVersionAsync(CommonDevice device)
        {
            ReadACFirewareVersionResponAllData result = null;
            var Gateway = device.Gateway;
            if (Gateway == null)
            {
                result = new ReadACFirewareVersionResponAllData { errorMessageBase = "当前没有网关" };
                return result;
            }
            return await System.Threading.Tasks.Task.Run(async () =>
            {
                Action<string, string> action = (topic, message) =>
                {
                    var gatewayID = topic.Split('/')[0];
                    var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        {
                            result = new ReadACFirewareVersionResponAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
                                if (command == "0259")
                                {
                                    var tempD = new ReadACFirewareVersionResponData();
                                    tempD.Status = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
                                    if (data.Length == 82)
                                    {
                                        var firewareString = data.Substring(12);
                                        var aa = firewareString.Length;
                                        firewareVersion = firewareString;
                                        var bytes = new byte[firewareString.Length / 2];
                                        for (int i = 0; i < bytes.Length; i++)
                                        {
                                            bytes[i] = Convert.ToByte(firewareString.Substring(i * 2, 2), 16);
                                        }
                                        var firewareVersionTemp = System.Text.Encoding.ASCII.GetString(bytes);
                                        tempD.FirewareVersion = firewareVersionTemp.Replace('\0', ' ').Trim();
                                    }
                                    result = new ReadACFirewareVersionResponAllData { readACFirewareVersionResponData = tempD };
                                    System.Console.WriteLine($"UI收到通知后的主题_command:0258_{topic}");
                                }
                            }
                        }
                    }
                };
                Gateway.Actions += action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
                try
                {
                    var passData = ReadACFirewareVersionData("01");
                    var jObject = new JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                    var data = new JObject { { "PassData", passData } };
                    jObject.Add("Data", data);
                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
                }
                catch { }
                var dateTime = DateTime.Now;
                while ((DateTime.Now - dateTime).TotalMilliseconds < 3000)
                {
                    await System.Threading.Tasks.Task.Delay(10);
                    if (result != null)
                    {
                        break;
                    }
                }
                if ((DateTime.Now - dateTime).TotalMilliseconds > 3000)
                {
                    result = new ReadACFirewareVersionResponAllData { errorMessageBase = " 回复超时,请重新操作" };
                }
                Gateway.Actions -= action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
                return result;
            });
        }
        /// <summary>
        /// 读取IRACC模块固件版本
        /// </summary>
        string ReadACFirewareVersionData(string reserve)
        {
            string data = "";
            string dataLength = "05";
            string dataComand1 = "58";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "01";
            string reserveData = reserve;
            try
            {
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                    reserveData;
            }
            catch { };
            return data;
        }
        /// <summary>
        /// IRACC模块固件版本,网关反馈信息
        /// </summary>
        public ReadACFirewareVersionResponAllData readACFirewareVersionResponAllData;
        /// <summary>
        /// IRACC模块固件版本,网关反馈信息
        /// </summary>
        [System.Serializable]
        public class ReadACFirewareVersionResponAllData
        {
            /// <summary>
            /// 错误信息
            /// </summary>
            public string errorMessageBase;
            /// <summary>
            /// 网关信息错误反馈
            /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para>
            /// </summary>
            public CommonDevice.ErrorResponData errorResponData;
            /// <summary>
            /// IRACC模块固件版本信息
            /// </summary>
            public ReadACFirewareVersionResponData readACFirewareVersionResponData;
        }
        /// <summary>
        /// IRACC模块固件版本的数据
        /// </summary>
        [System.Serializable]
        public class ReadACFirewareVersionResponData
        {
            /// <summary>
            /// 状态
            ///<para>0--成功</para>
            ///<para>1--失败</para>
            ///<para>ff--无效</para>
            /// </summary>
            public int Status;
            /// <summary>
            /// 固件版本
            /// </summary>
            public string FirewareVersion;
        }
        #endregion
        #region 升级IRACC模块通知(APP -> Zigbee MCU)
        ///<summary >
        ///升级IRACC模块通知
        /// <para>firewareVer:固件版本</para>
        /// <para>firewareSize:固件大小</para>
        /// </summary>
        public async System.Threading.Tasks.Task<ResponseAllData> UpggradeACNotificationAsync(CommonDevice device, string firewareVer, long firewareSize)
        {
            ResponseAllData result = null;
            var Gateway = device.Gateway;
            if (Gateway == null)
            {
                result = new ResponseAllData { errorMessageBase = "当前没有网关" };
                return result;
            }
            return await System.Threading.Tasks.Task.Run(async () =>
            {
                Action<string, string> action = (topic, message) =>
                {
                    var gatewayID = topic.Split('/')[0];
                    var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        {
                            result = new ResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
                                if (command == "025b")
                                {
                                    var tempD = new ResponseData();
                                    if (data.Length == 12)
                                    {
                                        tempD.status = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
                                    }
                                    result = new ResponseAllData { responseData = tempD };
                                    System.Console.WriteLine($"UI收到通知后的主题_{ topic}");
                                }
                            }
                        }
                    }
                };
                Gateway.Actions += action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
                try
                {
                    var passData = UpggradeACNotificationData(firewareVer, firewareSize);
                    var jObject = new JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                    var data = new JObject { { "PassData", passData } };
                    jObject.Add("Data", data);
                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
                }
                catch { }
                var dateTime = DateTime.Now;
                while ((DateTime.Now - dateTime).TotalMilliseconds < 3000)
                {
                    await System.Threading.Tasks.Task.Delay(10);
                    if (result != null)
                    {
                        break;
                    }
                }
                if ((DateTime.Now - dateTime).TotalMilliseconds > 3000)
                {
                    result = new ResponseAllData { errorMessageBase = " 回复超时,请重新操作" };
                }
                Gateway.Actions -= action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
                return result;
            });
        }
        private string firewareVersion = string.Empty;
        /// <summary>
        /// 升级IRACC模块通知返回
        /// </summary>
        string UpggradeACNotificationData(string firewareVer, long firewareSize)
        {
            string data = "";
            string dataLength = "2C";
            string dataComand1 = "5A";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "28";
            string deviceUpgradeMethod = "01";
            string firewareVersionData = "";
            string firewareSizeData = "";
            try
            {
                //固件版本
                var firewareVerBytes = System.Text.Encoding.ASCII.GetBytes(firewareVer);
                for (int i = 0; i < firewareVerBytes.Length; i++)
                {
                    var fw = Convert.ToString(firewareVerBytes[i], 16);
                    if (fw.Length == 1)
                    {
                        fw = "0" + fw;
                    }
                    firewareVersionData += fw;
                }
                var aa = firewareVersionData.Length;
                firewareVersionData = firewareVersionData.PadRight(70, '0');
                //固件尺寸
                var tempFwSize = Convert.ToString(firewareSize, 16);
                tempFwSize = tempFwSize.PadLeft(8, '0');
                for (int i = 6; i >= 0; i = i - 2)
                {
                    firewareSizeData += tempFwSize.Substring(i, 2);
                }
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                     deviceUpgradeMethod + firewareVersionData + firewareSizeData;
            }
            catch { };
            return data;
        }
        /// <summary>
        ///升级IRACC模块通知回复
        /// </summary>
        public ResponseAllData keyColorDataResponseAllData;
        [System.Serializable]
        public class ResponseAllData
        {
            /// <summary>
            /// 错误信息
            /// </summary>
            public string errorMessageBase;
            /// <summary>
            /// 网关信息错误反馈
            /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para>
            /// </summary>
            public CommonDevice.ErrorResponData errorResponData;
            /// <summary>
            /// 升级IRACC模块通知信息
            /// </summary>
            public ResponseData responseData;
        }
        /// <summary>
        /// 升级IRACC模块通知回复(Zigbee MCU -> APP)
        /// </summary>
        [System.Serializable]
        public class ResponseData
        {
            /// <summary>
            /// 状态值
            /// <para>0--版本号不一致(可以升级</para>
            /// <para>1--版本号一致(不用升级</para>
            /// <para>2--预留(暂时不用到</para>
            /// <para>ff--无效(暂时不用到)</para>
            /// </summary>
            public int status = -1;
        }
        #endregion
        #region 设备请求APP获取升级数据 (Zigbee MCU -> APP,主动上报)
        /// <summary>
        ///设备请求APP获取升级数据(Zigbee MCU -> APP,主动上报)
        /// </summary>
        [System.Serializable]
        public class DeviceRequestUpgradeResponseData
        {
            /// <summary>
            /// 数据偏移量,每个分包偏移量+(1-43)
            /// </summary>
            public string offset = string.Empty;
            /// <summary>
            /// 数据长度len
            /// </summary>
            public int dataLength = -1;
        }
        #endregion
        #region 发升级数据到设备(APP -> Zigbee MCU)
        ///<summary >
        ///读取IRACC模块固件版本
        /// <para>reserve:0-ff</para>
        /// </summary>
        public async void UpgradeAsync(CommonDevice device, SendUpgradeData upgradeData)
        {
            var Gateway = device.Gateway;
            if (Gateway == null)
            {
                return;
            }
            Action<string, string> action = (topic, message) => { };
            Gateway.Actions += action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
            try
            {
                string passData = "";
                if (upgradeData != null)
                {
                    passData = SendUpgrade(upgradeData);
                }
                var jObject = new JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                var data = new JObject { { "PassData", passData } };
                jObject.Add("Data", data);
                Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
            }
            catch { }
            Gateway.Actions -= action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
        }
        /// <summary>
        /// 发升级数据到设备
        /// </summary>
        string SendUpgrade(SendUpgradeData upgradeData)
        {
            string data = "";
            string dataLength = "";
            string dataComand1 = "5D";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "";
            string status = "";
            string offset = "";
            string upgradeDataLength = "";
            string dataString = "";
            try
            {
                var len = 4 + 1 + 4 + 1 + upgradeData.dataLength;
                dataLength = Convert.ToString(len, 16);
                if (dataLength.Length == 1)
                {
                    dataLength = "0" + dataLength;
                }
                addDataLength = Convert.ToString(6 + upgradeData.dataLength, 16);
                if (addDataLength.Length == 1)
                {
                    addDataLength = "0" + addDataLength;
                }
                if (upgradeData.status == 0)
                {
                    status = "00";
                }
                else if (upgradeData.status == 1)
                {
                    status = "01";
                }
                else
                {
                    status = "ff";
                }
                offset = upgradeData.offset;
                var dl = Convert.ToString(upgradeData.dataLength, 16);
                if (dl.Length == 1)
                {
                    upgradeDataLength = "0" + dl;
                }
                else
                {
                    upgradeDataLength = dl;
                }
                for (int i = 0; i < upgradeData.databytes.Length; i++)
                {
                    var dataB = Convert.ToString(upgradeData.databytes[i], 16);
                    if (dataB.Length == 1)
                    {
                        dataB = "0" + dataB;
                    }
                    dataString += dataB;
                }
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                status + offset + upgradeDataLength + dataString;
            }
            catch { };
            return data;
        }
        /// <summary>
        /// 发送升级数据到设备(APP -> Zigbee MCU)
        /// </summary>
        [System.Serializable]
        public class SendUpgradeData
        {
            /// <summary>
            /// 0--成功
            ///<para>1--失败</para>
            ///<para>ff--无效</para>
            /// </summary>
            public int status = 0;
            /// <summary>
            /// 数据偏移量,每个分包偏移量+(1-43)
            /// </summary>
            public string offset;
            /// <summary>
            /// 数据长度len
            /// </summary>
            public int dataLength = -1;
            /// <summary>
            /// 分包数据
            /// </summary>
            public byte[] databytes;
        }
        #endregion
        #region 分包结束(Zigbee MCU -> APP,主动上报)
        /// <summary>
        /// 设备请求APP获取分包结束命令(Zigbee MCU -> APP)
        /// </summary>
        [System.Serializable]
        public class DeviceRequestFinishResponseData
        {
            /// <summary>
            /// 0-ff
            /// </summary>
            public int reserve = -1;
        }
        #endregion
        #region 分包结束(APP -> Zigbee MCU)
        ///<summary >
        ///读取IRACC模块固件版本
        /// <para>status:0--成功;1--失败;ff--无效 .</para>
        /// </summary>
        public async void SendFinishAsync(CommonDevice device, int status)
        {
            var Gateway = device.Gateway;
            if (Gateway == null)
            {
                return;
            }
            Action<string, string> action = (topic, message) => { };
            Gateway.Actions += action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
            try
            {
                var passData = SendFinishDataString(status);
                var jObject = new JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                var data = new JObject { { "PassData", passData } };
                jObject.Add("Data", data);
                Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
            }
            catch { }
            Gateway.Actions -= action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
        }
        /// <summary>
        /// 发升级数据到设备
        /// </summary>
        string SendFinishDataString(int status)
        {
            string data = "";
            string dataLength = "05";
            string dataComand1 = "5F";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "01";
            string statusString = "";
            try
            {
                if (status == 0)
                {
                    statusString = "00";
                }
                else if (status == 1)
                {
                    statusString = "01";
                }
                else
                {
                    statusString = "ff";
                }
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                statusString;
            }
            catch { };
            return data;
        }
        /// <summary>
        /// 分包结束返回(APP -> Zigbee MCU
        /// </summary>
        //[System.Serializable]
        public class SendFinishData
        {
            /// <summary>
            /// 状态:成功/失败
            ///<para>0--成功<<para>
            ///<para>1--失败<<para>
            ///<para>ff--无效<<para>
            /// </summary>
            public int status = -1;
        }
        #endregion
        #endregion
    }
}
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs
@@ -136,8 +136,8 @@
        /// </summary>
        /// <param name="rollershade">窗帘对象</param>
        /// <param name="limiType">确认及覆盖上限位还是下限位</param>
        /// <param name="upLimit">上限位的值,百分比(备份用)</param>
        /// <param name="downLimit">下限位的值,百分比(备份用)</param>
        /// <param name="upLimit">上限位的值(长度值,不是百分比)</param>
        /// <param name="downLimit">下限位的值(长度值,不是百分比)</param>
        /// <returns></returns>
        public async Task<bool> CommitCurtainLimitPoint(Rollershade rollershade, Rollershade.CurtainPrivateInstalledLimi limiType, int upLimit, int downLimit)
        {
@@ -149,12 +149,9 @@
            }
            else
            {
                if (upLimit < 0) { upLimit = 0; }
                if (downLimit < 0) { downLimit = 100; }
                //这个是开合帘 "2,0x00ff,0x00ff"格式
                string convertData = "\"2,0x" + Convert.ToString(upLimit, 16).PadLeft(4, '0');
                convertData += ",0x" + Convert.ToString(downLimit, 16).PadLeft(4, '0') + "\"";
                //这个是开合帘 "2,0x00ff,0x00ff"格式 合限位在前,开限位在后
                string convertData = "\"2,0x" + Convert.ToString(downLimit, 16).PadLeft(4, '0');
                convertData += ",0x" + Convert.ToString(upLimit, 16).PadLeft(4, '0') + "\"";
                //然后将它们转为ASK码数值,然后再转为16进制
                //总计长度为17(这里是16进制)
                string sendData = "11";
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs
@@ -53,10 +53,6 @@
            {
                //先移除
                this.RemoveDeviceHardInfoThread(device);
                string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                this.hsGetHardInfoDevice.Add(mainkeys);
                if (HdlGatewayReceiveLogic.Current.IsEsixt("DeviceGetFixedAttribute") == false)
                {
                    //添加事件
@@ -89,6 +85,8 @@
                //不需要发送
                return;
            }
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
            this.hsGetHardInfoDevice.Add(mainkeys);
            //发送
            var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
            jObject.Add("Data", data);
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -425,6 +425,7 @@
        /// 重新绑定网关(1:正常  -1:异常  0:当前的网关绑定在了当前账号下的不同住宅里面)
        /// </summary>
        /// <param name="zbGateway">网关</param>
        /// <param name="btnMsg">消息控件</param>
        public async Task<int> ReBindNewGateway(ZbGateway zbGateway, NormalViewControl btnMsg = null)
        {
            if (zbGateway == null)
@@ -657,10 +658,10 @@
            }
            //获取全部设备
            bool result = LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay);
            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay);
            //关闭进度条
            ProgressBar.Close();
            if (result == false)
            if (result == -1)
            {
                return false;
            }
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -1334,6 +1334,21 @@
        }
        #endregion
        #region ■ 时间转换___________________________
        /// <summary>
        /// 将utc时间类型的字符串,转换为本地时间
        /// </summary>
        /// <param name="timeText"></param>
        /// <returns></returns>
        public static DateTime ConvertUtcTimeToLocalTime(string timeText)
        {
            var utcTime = Convert.ToDateTime(timeText);
            return TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local);
        }
        #endregion
        #region ■ 文件保存和读取_____________________
        /// <summary>
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
@@ -113,7 +113,7 @@
            rowInfo.btnIcon = btnIcon;
            //设备名称
            var btnDeviceName = new NormalViewControl(400, 60, true);
            var btnDeviceName = new NormalViewControl(700, 60, true);
            btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
            btnDeviceName.X = Application.GetRealWidth(193);
            btnDeviceName.Y = Application.GetRealHeight(45);
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
@@ -20,6 +20,14 @@
        /// 当前选择的网关
        /// </summary>
        private AC deviceAc = null;
        /// <summary>
        /// 摆风模式(用二进制来玩自定义模式 0:不使用 1:使用)
        /// </summary>
        private int swingMode = 0;
        /// <summary>
        /// 固定预留的数据
        /// </summary>
        private string fixValue = null;
        #endregion
@@ -39,8 +47,27 @@
            //初始化右上角菜单
            this.InitTopRightMenu();
            //初始化中部控件
            this.InitMiddleFrame();
            HdlThreadLogic.Current.RunThread(() =>
            {
                //开启进度条
                this.ShowProgressBar();
                //读取空调摆风模式
                var result = this.ReadAirConditionerSwingModeSupport();
                if (result == false)
                {
                    //关闭进度条
                    this.CloseProgressBar(ShowReLoadMode.YES);
                    return;
                }
                //关闭进度条
                this.CloseProgressBar();
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //初始化中部控件
                    this.InitMiddleFrame();
                });
            });
        }
        /// <summary>
@@ -125,6 +152,43 @@
                form.AddForm(deviceAc);
            };
            //摆风
            var rowSwing = new FrameRowControl(listview.rowSpace / 2);
            rowSwing.UseClickStatu = false;
            listview.AddChidren(rowSwing);
            rowSwing.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAirConditionerSwing), 400);
            rowSwing.AddBottomLine();
            var btnSwingSwitch = rowSwing.AddMostRightSwitchIcon();
            if (this.swingMode == 1)
            {
                btnSwingSwitch.IsSelected = true;
            }
            btnSwingSwitch.ButtonClickEvent += (sender, e) =>
            {
                //不能再点击
                btnSwingSwitch.CanClick = false;
                string statu = btnSwingSwitch.IsSelected == true ? "1" : "0";
                //将二进制转换为十进制
                int sendData = Convert.ToInt32(this.fixValue + statu, 2);
                HdlThreadLogic.Current.RunThread(async () =>
                {
                    var result = await HdlDeviceAirConditionerLogic.Current.SetUseAcSwingFunctionStatu(deviceAc, sendData);
                    if (result == true)
                    {
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            btnSwingSwitch.IsSelected = !btnSwingSwitch.IsSelected;
                            this.swingMode = this.swingMode == 1 ? 0 : 1;
                            deviceAc.UseSwingFunction = btnSwingSwitch.IsSelected;
                            deviceAc.ReSave();
                        });
                    }
                    //能够继续点击
                    btnSwingSwitch.CanClick = true;
                });
            };
            //初始化桌布完成
            tableContr.FinishInitControl(bodyFrameLayout, this.listview);
            tableContr = null;
@@ -191,5 +255,56 @@
        }
        #endregion
        #region ■ 读取空调摆风模式___________________
        /// <summary>
        /// 读取空调摆风模式
        /// </summary>
        private bool ReadAirConditionerSwingModeSupport()
        {
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(deviceAc);
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("ReadAirConditionerModeSupport", ReceiveComandDiv.A设备属性上报, (report) =>
            {
                string checkKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
                if (checkKeys != mainkeys || report.DeviceStatusReport.CluterID != 514)
                {
                    return;
                }
                for (int i = 0; i < report.DeviceStatusReport.AttriBute.Count; i++)
                {
                    var data = report.DeviceStatusReport.AttriBute[i];
                    if (data.AttributeId == 4097)
                    {
                        HdlGatewayReceiveLogic.Current.RemoveEvent("ReadAirConditionerModeSupport");
                        //转换为二进制
                        var value = Convert.ToString(data.AttriButeData, 2).PadLeft(16, '0');
                        //这个设置是放在后面的
                        this.fixValue = value.Substring(0, value.Length - 15);
                        this.swingMode = Convert.ToInt32(value.Substring(this.fixValue.Length));
                    }
                }
            });
            //获取是否启用空调摆风模式的状态(打开 或者 关闭)
            deviceAc.ReadUseSwingFunctionStatu();
            int timeOut = 0;
            while (this.fixValue == null && timeOut <= 30)
            {
                System.Threading.Thread.Sleep(100);
                timeOut++;
            }
            if (this.fixValue == null)
            {
                //获取空调摆风状态失败
                string msg = Language.StringByID(R.MyInternationalizationString.uGetAirConditionerSwingFunctionFail);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "回复超时");
                this.ShowMassage(ShowMsgType.Tip, msg);
                return false;
            }
            return true;
        }
        #endregion
    }
}
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
@@ -568,7 +568,7 @@
                var btnBindName = new Button()
                {
                    Width = Application.GetRealWidth(500 - 120),
                    Width = Application.GetRealWidth(790),
                    X = devicePic.Right + Application.GetRealWidth(20),
                    TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                    TextAlignment = TextAlignment.CenterLeft,
@@ -645,7 +645,7 @@
                btnBindName.MouseUpEventHandler += hander;
                btnChoose.MouseUpEventHandler += hander;
                if (device.CommonDevice?.DeviceEpointName == "")
                if (string.IsNullOrEmpty(device.CommonDevice?.DeviceEpointName))
                {
                    btnBindName.Text = device.CommonDevice?.DeviceAddr + "_" + device.CommonDevice?.DeviceEpoint;
                }
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -79,7 +79,7 @@
                Text = Language.StringByID(R.MyInternationalizationString.FirstFloor),
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 14,
                IsBold =true,
                IsBold = true,
                TextAlignment = TextAlignment.CenterRight,
            };
            btnAddFrameLayout.AddChidren(btnFloorText);
@@ -146,7 +146,7 @@
                TextID = R.MyInternationalizationString.Save,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                IsBold =true,
                IsBold = true,
                TextSize = 16,
            };
            bottomFrameLayout.AddChidren(btnFinifh);
@@ -591,11 +591,11 @@
                var btnBindName = new Button()
                {
                    Width = Application.GetRealWidth(500 - 120),
                    Width = Application.GetRealWidth(790),
                    X = devicePic.Right + Application.GetRealWidth(20),
                    TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize =15,
                    TextSize = 15,
                };
                rowLayout.AddChidren(btnBindName);
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -97,7 +97,7 @@
                            {
                                currentClusterID = 258;
                            }
                            currentKey.ReSave();
                            //读取按键当前绑定目标
                            GetDeviceBindResponseAllData getBindList = null;
                            if (IsRead)
@@ -169,6 +169,7 @@
                                    currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddCurtain);
                                }
                            }
                            currentKey.ReSave();
                        }
                        #endregion 
                        Application.RunOnMainThread(() =>
@@ -208,13 +209,14 @@
            var btnAddFrameLayout = new FrameLayout()
            {
                X = Application.GetRealWidth(913),
                X = Application.GetRealWidth(888),
                Width = Application.GetRealWidth(192),
            };
            this.titleFrameLayout.AddChidren(btnAddFrameLayout);
            var btnBindAdd = new Button
            {
                X = Application.GetRealWidth(62),
                Height = Application.GetRealHeight(72),
                Width = Application.GetRealWidth(72),
                UnSelectedImagePath = "BindPic/BindAdd.png",
@@ -485,7 +487,7 @@
                                    devicePic.Width = Application.GetRealWidth(110);
                                    devicePic.Text = "";
                                }
                                if (tempDev.DeviceEpointName == "")
                                if (string.IsNullOrEmpty(tempDev.DeviceEpointName))
                                {
                                    btnBindNameText = tempDev.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit);
                                }
@@ -529,7 +531,7 @@
            modeRowLayout.BackgroundColor = ZigbeeColor.Current.XMWhite;
            midVerticalRefreshLayout.AddChidrenRow(modeRowLayout);
            modeRowLayout.frameTable.UseClickStatu = false;
            modeRowLayout.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.keyMode), 500);
            modeRowLayout.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.keyMode), 400);
            var btnKeyModeTipText = "";
            #region 当前模式文本显示
            switch (currentKey.panelMode)
@@ -575,7 +577,7 @@
                    break;
            }
            #endregion
            modeRowLayout.frameTable.AddMostRightView(btnKeyModeTipText, 500);
            modeRowLayout.frameTable.AddMostRightView(btnKeyModeTipText, 800);
            modeRowLayout.frameTable.AddBottomLine();
            var btnDel = modeRowLayout.AddDeleteControl();
            //一键清除按键事件
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -116,8 +116,8 @@
                    //Log出力
                    string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
                    HdlLogLogic.Current.WriteLog(ex, msg);
                    //出现未知错误
                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
                    //电机数据异常,请重置电机
                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uCurtainDataIsErrorPleaseResetCurtain));
                    try
                    {
                        this.listView.RemoveAll();
@@ -242,7 +242,7 @@
            btnProgress1.Text = progressValue + "%";
            frameBack.AddChidren(btnProgress1);
            //进度条
            this.openSeekBar = new  SeekBarControl(965);
            this.openSeekBar = new SeekBarControl(965);
            openSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
            openSeekBar.ProgressBarColor = 0xff288bfd;
            openSeekBar.Progress = progressValue;
@@ -352,17 +352,7 @@
                    }
                    oldProValue = nowValue;
                    checking = true;
                    if (curtainData.DeleteOpenLimit == true)
                    {
                        //重置开限位点
                        var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.UpLimit);
                        if (result == false)
                        {
                            checking = false;
                            continue;
                        }
                        curtainData.DeleteOpenLimit = false;
                    }
                    //将窗帘调整到指定百分比
                    this.sendDiv = 1;
                    curtainDevice.WcdGoToTiltValue(nowValue);
@@ -380,12 +370,15 @@
            string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainOpenLimitMsg);
            this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
            {
                decimal openValue = ((decimal)curtainData.OpenLimitPersent / 100) * curtainData.CurtainLength;
                decimal closeValue = ((decimal)curtainData.CloseLimitPersent / 100) * curtainData.CurtainLength;
                if (openValue < 0) { openValue = 0; }
                if (closeValue < 0) { closeValue = curtainData.CurtainLength; }
                //执行确认及覆盖上限位点
                var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
                    curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
                    (int)openValue, (int)closeValue);
                if (result == true)
                {
                    curtainData.DeleteOpenLimit = true;
                    this.receiveOpenlimit = false;
                }
            });
@@ -419,7 +412,7 @@
            btnProgress1.Text = progressValue + "%";
            frameBack.AddChidren(btnProgress1);
            //进度条
            this.closeSeekBar = new  SeekBarControl(965);
            this.closeSeekBar = new SeekBarControl(965);
            closeSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
            closeSeekBar.ProgressBarColor = 0xff288bfd;
            closeSeekBar.Progress = progressValue;
@@ -475,7 +468,7 @@
            frameBack.AddChidren(btnPlus);
            btnPlus.ButtonClickEvent += (sender, e) =>
            {
                if (closeSeekBar.Progress >=100)
                if (closeSeekBar.Progress >= 100)
                {
                    return;
                }
@@ -529,16 +522,7 @@
                    }
                    checking = true;
                    oldProValue = nowValue;
                    if (curtainData.DeleteCloseLimit == true)
                    {
                        //重置合限位点
                        var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.DownLimit);
                        if (result == false)
                        {
                            continue;
                        }
                        curtainData.DeleteCloseLimit = false;
                    }
                    //将窗帘调整到指定百分比
                    this.sendDiv = 2;
                    curtainDevice.WcdGoToTiltValue(nowValue);
@@ -556,12 +540,16 @@
            string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainCloseLimitMsg);
            this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
            {
                //执行确认及覆盖合限位点
                decimal openValue = ((decimal)curtainData.OpenLimitPersent / 100) * curtainData.CurtainLength;
                decimal closeValue = ((decimal)curtainData.CloseLimitPersent / 100) * curtainData.CurtainLength;
                if (openValue < 0) { openValue = 0; }
                if (closeValue < 0) { closeValue = curtainData.CurtainLength; }
                //执行确认及覆盖上限位点
                var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
                    curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
                    (int)openValue, (int)closeValue);
                if (result == true)
                {
                    curtainData.DeleteCloseLimit = true;
                    this.receiveCloseLimit = false;
                }
            });
@@ -726,7 +714,7 @@
                    //方向备份
                    await HdlDeviceCurtainLogic.Current.BackupCurtainDirection(curtainDevice, curtainData.Direction);
                    //限位备份
                    int uplimit= (int)(curtainData.OpenLimitValue / (curtainData.CurtainLength * 1.0) * 100);
                    int uplimit = (int)(curtainData.OpenLimitValue / (curtainData.CurtainLength * 1.0) * 100);
                    int downlimit = (int)(curtainData.CloseLimitValue / (curtainData.CurtainLength * 1.0) * 100);
                    await HdlDeviceCurtainLogic.Current.BackupCurtainLimitPoint(curtainDevice, uplimit, downlimit);
                });
@@ -806,14 +794,6 @@
            /// false:电机方向正向;true:电机方向反向
            /// </summary>
            public bool Direction = false;
            /// <summary>
            /// 是否重置开限位点
            /// </summary>
            public bool DeleteOpenLimit = true;
            /// <summary>
            /// 是否重置合限位点
            /// </summary>
            public bool DeleteCloseLimit = true;
            /// <summary>
            /// 开限位的值
            /// </summary>
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
@@ -37,7 +37,7 @@
            //清空bodyFrame
            this.ClearBodyFrame();
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
            var listView = new VerticalListControl(12);
            listView.BackgroundColor = UserCenterColor.Current.White;
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -132,21 +132,10 @@
            frame.AddChidren(listView);
            listView.BeginHeaderRefreshingAction += () =>
            {
                //下拉刷新
                HdlThreadLogic.Current.RunThread(() =>
                {
                    //获取全部设备
                    bool result = LocalDevice.Current.SetDeviceToMemmoryByGateway(GatewayResourse.NowSelectGateway);
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        //隐藏下拉刷新特效
                        listView.EndHeaderRefreshing();
                        if (result == true)
                        {
                            //重新刷新界面
                            this.InitMiddleFrame(false);
                        }
                    });
                    //下拉刷新
                    this.ListViewBeginHeaderRefreshing();
                });
            };
        }
@@ -175,6 +164,10 @@
            //根据MAC合并设备列表
            this.MargeAllDeviceByMac(listDevice);
            if (this.Parent == null)
            {
                return;
            }
            HdlThreadLogic.Current.RunMain(() =>
            {
                var listOta = new List<OTADevice>();
@@ -528,6 +521,60 @@
        #endregion
        #region ■ 下拉刷新___________________________
        /// <summary>
        /// 滑动控件下拉刷新
        /// </summary>
        private async void ListViewBeginHeaderRefreshing()
        {
            //如果是在线的
            if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(GatewayResourse.NowSelectGateway) == true)
            {
                //检测广播到的这个网关是否拥有住宅ID
                ZbGateway realWay = null;
                if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, GatewayResourse.NowSelectGateway) == true)
                {
                    //重新设置住宅ID(这个应该是不经过APP,直接把网关恢复了出厂设置)
                    if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true)
                    {
                        //显示进度条
                        ProgressBar.Show();
                        int result2 = await HdlGatewayLogic.Current.ReBindNewGateway(realWay);
                        //关闭进度条
                        ProgressBar.Close();
                        if (result2 == -1)
                        {
                            return;
                        }
                    }
                }
            }
            if (this.Parent == null)
            {
                return;
            }
            //获取全部设备
            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(GatewayResourse.NowSelectGateway);
            if (this.Parent == null)
            {
                return;
            }
            HdlThreadLogic.Current.RunMain(() =>
            {
                //隐藏下拉刷新特效
                listView.EndHeaderRefreshing();
                if (result != -1)
                {
                    //重新刷新界面
                    this.InitMiddleFrame(false);
                }
            });
        }
        #endregion
        #region ■ 网关在线检测_______________________
        /// <summary>
@@ -625,7 +672,16 @@
            {
                //这里主要只是获取在线状态
                var zbway = HdlGatewayLogic.Current.GetLocalGateway(gwId);
                var result = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatu, ShowErrorMode.NO);
                int statu = 0;
                var list = LocalDevice.Current.GetDeviceListFromGateway(zbway, ref statu, false, ShowErrorMode.NO);
                if (statu != -1)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        //设置设备在线状态
                        this.ReceiveDeviceStatu(list[i]);
                    }
                }
            });
        }
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -1196,7 +1196,7 @@
            HdlThreadLogic.Current.RunThread(async () =>
            {
                //读取空调模块版本
                var result = await ((AC)listNewDevice[0]).ReadACFirewareVersionAsync();
                var result = await HdlDeviceAirConditionerLogic.Current.ReadACFirewareVersionAsync(listNewDevice[0]);
                if (result == null || result.readACFirewareVersionResponData == null || result.readACFirewareVersionResponData.Status != 0)
                {
                    HdlThreadLogic.Current.RunMain(() =>
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -21,9 +21,9 @@
        /// </summary>
        private bool isDeviceThreadStart = false;
        /// <summary>
        /// 等待设备的回馈的超时时间(单位:秒)
        /// 等待设备的回馈的超时时间(单位:百毫秒)
        /// </summary>
        private int waitDeviceTimeOut = 3;
        private int waitDeviceTimeOut = 20;
        /// <summary>
        /// 主题超时的线程是否开启
        /// </summary>
@@ -226,7 +226,7 @@
                }
                //刷新超时时间
                this.waitDeviceTimeOut = 3;
                this.waitDeviceTimeOut = 20;
                //获取设备的固定属性
                HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device);
@@ -263,12 +263,12 @@
                while (this.waitDeviceTimeOut >= 0)
                {
                    //等待下一个回路
                    System.Threading.Thread.Sleep(1000);
                    System.Threading.Thread.Sleep(100);
                    this.waitDeviceTimeOut--;
                }
                //停止接收
                this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
                System.Threading.Thread.Sleep(500);
                System.Threading.Thread.Sleep(200);
                //目前就弄一个
                Application.RunOnMainThread(() =>
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -208,7 +208,7 @@
                    {
                        foreach (var curDoorLockUser in getDoorLockInfoAllList)
                        {
                            if (curDoorLockUser.DoorLockLocalUserId == null || curDoorLockUser.DoorLockLocalUserId == "")
                            if (string.IsNullOrEmpty(curDoorLockUser.DoorLockLocalUserId))
                            {
                                continue;
                            }
@@ -296,7 +296,7 @@
                            {
                                foreach (var curDoorLockUser in getDoorLockInfoList.PageData)
                                {
                                    if (curDoorLockUser.DoorLockLocalUserId == null || curDoorLockUser.DoorLockLocalUserId == "")
                                    if (string.IsNullOrEmpty(curDoorLockUser.DoorLockLocalUserId))
                                    {
                                        continue;
                                    }
@@ -398,7 +398,7 @@
                {
                    foreach (var curDoorLockUser in getDoorLockInfoAllList)
                    {
                        if (curDoorLockUser.DoorLockLocalUserId == null || curDoorLockUser.DoorLockLocalUserId == "")
                        if (string.IsNullOrEmpty(curDoorLockUser.DoorLockLocalUserId))
                        {
                            continue;
                        }
@@ -438,7 +438,7 @@
                        //获取云端存储的门锁成员信息
                        foreach (var curDoorLockUser in getDoorLockInfoList.PageData)
                        {
                            if (curDoorLockUser.CloudAccountId == "" || curDoorLockUser.CloudAccountId != subAccountDistributedMark)
                            if (string.IsNullOrEmpty(curDoorLockUser.CloudAccountId) || curDoorLockUser.CloudAccountId != subAccountDistributedMark)
                            {
                                continue;
                            }
@@ -596,7 +596,7 @@
                {
                    var curDoorLockUser = doorLock.localDoorLockAccountList[curUserId];
                    if (curDoorLockUser.ConnectedAccount == "" || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark)
                    if (string.IsNullOrEmpty(curDoorLockUser.ConnectedAccount) || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark)
                    {
                        continue;
                    }
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -19,7 +19,7 @@
        public FrameLayout bottomRadiusFrameLayout = new FrameLayout()
        {
            Height = Application.GetRealHeight(906),
            Height = Application.GetRealHeight(806),
            Y = Application.GetRealHeight(930),
            BackgroundColor = ZigbeeColor.Current.XMWhite,
        };
@@ -56,6 +56,14 @@
            TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
            TextSize = 14,
        };
        public Button line = new Button()
        {
            Y = Application.GetRealHeight(138),
            Height = 1,
            BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
        };
        #endregion
        /// <summary> 
@@ -181,6 +189,7 @@
            this.bottomRadiusFrameLayout.AddChidren(btnCancel);
            this.bottomRadiusFrameLayout.AddChidren(btnBottomTitle);
            this.bottomRadiusFrameLayout.AddChidren(btnFinish);
            this.bottomRadiusFrameLayout.AddChidren(line);
        }
        /// <summary>
@@ -288,8 +297,8 @@
                            alert.ConfirmClickEvent += () =>
                            {
                                var form = new UserCenter.UserMain.SecondAuthenticationForm();
                                form.AddForm();
                            };
                                form.AddForm();
                            };
                        }
                        doorLock.ReSave();
                    }
@@ -334,7 +343,7 @@
            {
                var form = new UserCenter.UserMain.SecondAuthenticationForm();
                form.AddForm();
            };
            };
        }
        /// <summary>
@@ -346,7 +355,7 @@
        /// <param name="btnDoorLockPic">门锁图片开/关显示</param>
        public void RemoteUnlockRequest(ZigBee.Device.DoorLock doorLock, Action action, Button progressButton = null, Button btnDoorLockPic = null, Button btnStatus = null, Button btnDoorLockTitle = null)
        {
            if (doorLock.RemoteUnlockPassword == "")
            if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
            {
                string msgRemoteUnlockRequest = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock);
                var alertRemoteUnlockRequest = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgRemoteUnlockRequest, Language.StringByID(R.MyInternationalizationString.GoSetting));
@@ -405,7 +414,7 @@
                {
                    var form = new UserCenter.UserMain.SecondAuthenticationForm();
                    form.AddForm();
                };
                };
                return;
            }
@@ -600,7 +609,7 @@
                    });
                };
                HdlCheckLogic.Current.CheckSecondarySecurity(action);
            };
            };
        }
        // 获取到到名称更改回调通知
        public Action<string> devicNameSecAction;
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
@@ -66,7 +66,7 @@
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                Gravity = Gravity.CenterHorizontal,
                TextSize = 20,
                IsBold =true,
                IsBold = true,
            };
            this.midFrameLayout.AddChidren(btnPicTip);
@@ -194,7 +194,7 @@
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                Radius = (uint)Application.GetRealHeight(127 / 2),
                TextSize = 16,
                IsBold =true,
                IsBold = true,
            };
            bottomFrameLayout.AddChidren(completeBtn);
@@ -213,7 +213,8 @@
                btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.ProximityRemark);
                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.ProximityCard) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
            }
            if (curAccountObj.UserName != "" && curAccountObj.UserName != null)
            if (!string.IsNullOrEmpty(curAccountObj.UserName))
            {
                btnMatchPersonContent.Text = curAccountObj.UserName;
            }
@@ -244,7 +245,7 @@
                 addLockInfo.OpenLockMode = doorLock.doorLockProgrammingEventNotificationCommand.ProgramEventSoure;
                 addLockInfo.DoorLockLocalUserId = doorLock.doorLockProgrammingEventNotificationCommand.UserID.ToString();
                 addLockInfo.EntryTime = System.DateTime.Now;
                 if (btnPasswordRemarkContent.Text != "")
                 if (!string.IsNullOrEmpty(btnPasswordRemarkContent.Text))
                 {
                     addLockInfo.UserIdRemarks = btnPasswordRemarkContent.Text;
                 }
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -113,10 +113,10 @@
                Height = Application.GetRealHeight(1319),
                Y = Application.GetRealHeight(418),
                BackgroundColor = ZigbeeColor.Current.XMWhite,
            };
            };
            this.midFrameLayout.AddChidren(bottomFrameLayout);
            bottomFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            var informationEdit = new Button()
            {
                Height = Application.GetRealHeight(60),
@@ -284,7 +284,7 @@
                    btnNext.SelectedImagePath = "DoorLock/SwitchOn.png";
                    btnLine.Visible = true;
                    btnLine.Y = Application.GetRealHeight(853);
                    if (doorLock.RemoteUnlockPassword == "")
                    if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                    {
                        btnNext.IsSelected = false;
                    }
@@ -333,7 +333,7 @@
                                     btnNext.IsSelected = !btnNext.IsSelected;
                                     if (btnNext.IsSelected)
                                     {
                                         if (doorLock.RemoteUnlockPassword == "")
                                         if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                                         {
                                             RemotePasswordDialog(doorLock, btnNext);
                                         }
@@ -358,7 +358,7 @@
                             btnNext.IsSelected = !btnNext.IsSelected;
                             if (btnNext.IsSelected)
                             {
                                 if (doorLock.RemoteUnlockPassword == "")
                                 if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                                 {
                                     RemotePasswordDialog(doorLock, btnNext);
                                 }
@@ -407,7 +407,7 @@
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                TextSize = 16,
                IsBold =true,
                IsBold = true,
            };
            this.midFrameLayout.AddChidren(btnFinifh);
            btnFinifh.MouseUpEventHandler += (sender, e) =>
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
@@ -72,24 +72,7 @@
        public void BottomFrameLayout()
        {
            #region  UI
            //var bottomFrameLayout = new FrameLayout()
            //{
            //    Height = Application.GetRealHeight(100),
            //    Y = Application.GetRealHeight(418),
            //    Radius = 17,
            //    BackgroundColor = ZigbeeColor.Current.XMWhite,
            //};
            //this.midFrameLayout.AddChidren(bottomFrameLayout);
            //var bottomFrameLayout1 = new FrameLayout()
            //{
            //    Height = Application.GetRealHeight(1319 - 50),
            //    Y = Application.GetRealHeight(418 + 48),
            //    BackgroundColor = ZigbeeColor.Current.XMWhite,
            //};
            //this.midFrameLayout.AddChidren(bottomFrameLayout1);
            #region  UI
            var bottomFrameLayout = new FrameLayout()
            {
                Height = Application.GetRealHeight(1319),
@@ -256,7 +239,7 @@
                    btnNext.SelectedImagePath = "DoorLock/SwitchOn.png";
                    btnLine.Visible = true;
                    btnLine.Y = Application.GetRealHeight(714);
                    if (doorLock.RemoteUnlockPassword == "")
                    if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                    {
                        btnNext.IsSelected = false;
                    }
@@ -280,7 +263,7 @@
                                 btnNext.IsSelected = !btnNext.IsSelected;
                                 if (btnNext.IsSelected)
                                 {
                                     if (doorLock.RemoteUnlockPassword == "")
                                     if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                                     {
                                         RemotePasswordDialog(doorLock, btnNext);
                                     }
@@ -323,7 +306,7 @@
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                TextSize = 16,
                IsBold =true,
                IsBold = true,
            };
            this.midFrameLayout.AddChidren(btnFinifh);
            btnFinifh.MouseUpEventHandler += (sender, e) =>
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
@@ -219,25 +219,25 @@
                        unLockMethod.Show();
                    }
                    else if (currentIndex == 1)
                    {
                    {
                        if (!btnRight.IsSelected)
                        {
                            FreezeUser(true);
                            FreezeUser(true);
                        }
                        else
                        {
                            FreezeUser(false);
                            FreezeUser(false);
                        }
                    }
                    else if (currentIndex == 2)
                    {
                    {
                        if (!btnRight.IsSelected)
                        {
                            HasRemoteUnlockAccessMethod(true);
                            HasRemoteUnlockAccessMethod(true);
                        }
                        else
                        {
                            HasRemoteUnlockAccessMethod(false);
                            HasRemoteUnlockAccessMethod(false);
                        }
                    }
                };
@@ -299,8 +299,8 @@
                            foreach (var curDoorLockUser in curAccountDoorLockUserList)
                            {
                                // 账户中没有门锁用户
                                if (curDoorLockUser.DoorLockLocalUserId == null || curDoorLockUser.DoorLockLocalUserId == "")
                                {
                                if (string.IsNullOrEmpty(curDoorLockUser.DoorLockLocalUserId))
                                {
                                }
                                else
                                {
@@ -325,16 +325,16 @@
                            }
                            //冻结/解冻用户
                            int count1 = tempGroupId.Count;
                            if (tempGroupId.Count==1)
                            if (tempGroupId.Count == 1)
                            {
                                foreach (var a in tempGroupId)
                                {
                                    if(a.Count ==0)
                                    if (a.Count == 0)
                                    {
                                        count1 = 0;
                                        break;
                                    }
                                }
                                }
                            }
                            int count2 = 0;
@@ -357,8 +357,8 @@
                                    else if (resultData.defaultControlResponseData.status == 33)
                                    {
                                        count2++;
                                    }
                                    System.Threading.Thread.Sleep(1000);
                                    }
                                    System.Threading.Thread.Sleep(1000);
                                }
                                else
                                {
@@ -370,7 +370,7 @@
                                }
                                tempCount++;
                            }
                            // 批量冻结门锁中的账户后,准备冻结云端账户
                            if (count2 == count1)
                            {
@@ -565,7 +565,7 @@
                        });
                    }
                });
            };
            };
        }
        //是否给子账户拥有远程开锁的条件
@@ -761,7 +761,7 @@
                        });
                    }
                });
            };
            };
        }
        #region ◆ 接口实现__________________________
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
@@ -287,6 +287,7 @@
                    var mUIPickerView = new UIPickerView()
                    {
                        X = Application.GetRealWidth(0),
                        Height = Application.GetRealHeight(440),
                    };
                    this.bottomRadiusFrameLayout.AddChidren(mUIPickerView);
@@ -302,7 +303,7 @@
                            this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentDate;
                        }
                        mUIPickerView.Y = Application.GetRealWidth(110);
                        mUIPickerView.Y = Application.GetRealWidth(245);
                        var mList1 = new List<string>();
                        var mList2 = new List<string>();
                        var mList3 = new List<string>();
@@ -311,20 +312,20 @@
                        int year = dtNow.Year + 1;
                        int days = DateTime.DaysInMonth(dtNow.Year, dtNow.Month);
                        for (int y = dtNow.Year - 10; y < dtNow.Year + 1; y++)
                        for (int y = dtNow.Year - 9; y < dtNow.Year + 1; y++)
                        {
                            mList1.Add(y.ToString());
                        }
                        for (int m = 1; m < 13; m++)
                        {
                            if(Language .CurrentLanguage == "Chinese")
                            if (Language.CurrentLanguage == "Chinese")
                            {
                                mList2.Add(m.ToString()+"月");
                                mList2.Add(m.ToString() + "月");
                            }
                            else
                            {
                                mList2.Add(m.ToString());
                            }
                            }
                        }
                        for (int d = 1; d < days + 1; d++)
                        {
@@ -335,7 +336,7 @@
                            else
                            {
                                mList3.Add(d.ToString());
                            }
                            }
                        }
                        if (setTimeType != "DoorLockTime")
@@ -393,7 +394,7 @@
                        else
                        {
                            mUIPickerView.setNPicker(mList1, mList2, mList3);
                            mUIPickerView.setCurrentItems(dtNow.Year, dtNow.Month - 1, dtNow.Day - 1);
                            mUIPickerView.setCurrentItems(9, dtNow.Month - 1, dtNow.Day - 1);
                            curYear = dtNow.Year;
                            curMonth = dtNow.Month;
                            curDay = dtNow.Day;
@@ -439,7 +440,7 @@
                                else
                                {
                                    mUIPickerView.setNPicker(mList1, mList2, mList3);
                                    mUIPickerView.setCurrentItems(curYear, curMonth - 1, curDay - 1);
                                    mUIPickerView.setCurrentItems(9, curMonth - 1, curDay - 1);
                                }
                            }
                        };
@@ -472,7 +473,7 @@
                            this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentTime;
                        }
                        mUIPickerView.Y = Application.GetRealWidth(95);
                        mUIPickerView.Y = Application.GetRealWidth(245);
                        var mList1 = new List<string>();
                        var mList2 = new List<string>();
                        for (int h = 0; h < 24; h++)
@@ -576,6 +577,14 @@
                textDisplayDateFrameLayout.MouseDownEventHandler += hander;
                btnNextFrameLayout.MouseDownEventHandler += hander;
                btnNext.MouseDownEventHandler += hander;
                if (curIndex == 0)
                {
                    textDisplayDate.MouseDownEventHandler += hander;
                }
                else
                {
                    textDisplayTime.MouseDownEventHandler += hander;
                }
            }
            btnCancel.MouseUpEventHandler += (sender1, e1) =>
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -210,10 +210,12 @@
            };
            midTopFrameLayout.AddChidren(btnNext);
            btnNext.MouseUpEventHandler += (sender, e) =>
            EventHandler<MouseEventArgs> handerSideLip = (sender, e) =>
            {
                SideslipFramelayout();
            };
            btnNext.MouseUpEventHandler += handerSideLip;
            btnAllMethod.MouseUpEventHandler += handerSideLip;
            var btnLine = new Button
            {
                Y = midTopFrameLayout.Bottom,
@@ -298,7 +300,7 @@
            {
                var curDoorLockUser = doorLock.localDoorLockUserList[curUserId];
                if (curDoorLockUser.ConnectedAccount == "" || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark)
                if (string.IsNullOrEmpty(curDoorLockUser.ConnectedAccount) || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark)
                {
                    continue;
                }
@@ -360,8 +362,7 @@
                            break;
                    }
                    #region UI
                    #region UI
                    var rowFrameLayout = new RowLayoutControl(bodyView.rowSpace / 2);
                    rowFrameLayout.BackgroundColor = ZigbeeColor.Current.XMWhite;
                    bodyView.AddChidren(rowFrameLayout);
@@ -370,7 +371,7 @@
                    btnicon.UnSelectedImagePath = "DoorLock/DoorLockUserPic.png";
                    //上面门锁用户名称一行 
                    var memberText = "";
                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                    if (string.IsNullOrEmpty(curAccountObj.UserName))
                    {
                        memberText = curAccountObj.Account;
                    }
@@ -532,7 +533,7 @@
                    switch (curDoorLockUser.UnlockType)
                    {
                        case 0:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
@@ -542,7 +543,7 @@
                            }
                            break;
                        case 3:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
@@ -552,7 +553,7 @@
                            }
                            break;
                        case 15:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
@@ -729,7 +730,7 @@
                        break;
                }
                if (doorLock.currentUserDisplayMethod == "" && i == 0)
                if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
@@ -102,7 +102,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 12,
                IsBold =true,
                IsBold = true,
            };
            midTopFrameLayout.AddChidren(btnAllMethod);
            // 类型区分 
@@ -137,11 +137,12 @@
                SelectedImagePath = "DoorLock/UnLockSideslipIcon.png",
            };
            midTopFrameLayout.AddChidren(btnNext);
            btnNext.MouseUpEventHandler += (sender, e) =>
            EventHandler<MouseEventArgs> handerSideLip = (sender, e) =>
            {
                SideslipFramelayout();
            };
            btnNext.MouseUpEventHandler += handerSideLip;
            btnAllMethod.MouseUpEventHandler += handerSideLip;
            var btnLine = new Button
            {
                Y = midTopFrameLayout.Bottom,
@@ -173,7 +174,7 @@
            foreach (var curUserId in doorLock.localDoorLockUserList.Keys)
            {
                var curDoorLockUser = doorLock.localDoorLockUserList[curUserId];
                if (curDoorLockUser.ConnectedAccount != "")
                if (!string.IsNullOrEmpty(curDoorLockUser.ConnectedAccount))
                {
                    continue;
                }
@@ -244,7 +245,7 @@
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                    Gravity = Gravity.CenterVertical,
                    TextSize =15,
                    TextSize = 15,
                };
                rowFrameLayout.AddChidren(btnText);
@@ -267,7 +268,7 @@
                switch (curDoorLockUser.UnlockType)
                {
                    case 0:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                        {
                            btnText.Text = curDoorLockUser.UserName;
                        }
@@ -277,7 +278,7 @@
                        }
                        break;
                    case 3:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                        {
                            btnText.Text = curDoorLockUser.UserName;
                        }
@@ -287,7 +288,7 @@
                        }
                        break;
                    case 15:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                        {
                            btnText.Text = curDoorLockUser.UserName;
                        }
@@ -326,7 +327,7 @@
            {
                Height = Application.GetRealHeight(100),
                Y = Application.GetRealHeight(1253),
                Radius =(uint) Application.GetRealHeight(100/2),
                Radius = (uint)Application.GetRealHeight(100 / 2),
                BackgroundColor = ZigbeeColor.Current.XMWhite,
            };
            flMain.AddChidren(bottomFrameLayout);
@@ -334,7 +335,7 @@
            var bottomFrameLayout1 = new FrameLayout()
            {
                Height = Application.GetRealHeight(668 - 60),
                Y = Application.GetRealHeight(1253+58),
                Y = Application.GetRealHeight(1253 + 58),
                BackgroundColor = ZigbeeColor.Current.XMWhite,
            };
            flMain.AddChidren(bottomFrameLayout1);
@@ -457,7 +458,7 @@
                    btnLine.Visible = false;
                }
                if (currentAccount.UserName != "" && currentAccount.UserName != null)
                if (!string.IsNullOrEmpty(currentAccount.UserName))
                {
                    btnUserName.Text = currentAccount.UserName;
                }
@@ -547,7 +548,7 @@
                           switch (curDoorLockUser.UnlockType)
                           {
                               case 0:
                                   if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                                   if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                                   {
                                       addLockInfo.UserIdRemarks = curDoorLockUser.UserName;
                                   }
@@ -557,7 +558,7 @@
                                   }
                                   break;
                               case 3:
                                   if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                                   if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                                   {
                                       addLockInfo.UserIdRemarks = curDoorLockUser.UserName;
                                   }
@@ -567,7 +568,7 @@
                                   }
                                   break;
                               case 15:
                                   if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                                   if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                                   {
                                       addLockInfo.UserIdRemarks = curDoorLockUser.UserName;
                                   }
@@ -753,7 +754,7 @@
                        break;
                }
                if (doorLock.currentUserDisplayMethod == "" && i == 0)
                if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
@@ -266,31 +266,36 @@
                    }
                    //这里主要只是获取在线状态
                    var zbway = HdlGatewayLogic.Current.GetLocalGateway(listGwId[i]);
                    var result = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, (device) =>
                     {
                         string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                         if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true)
                         {
                             return;
                         }
                         listCheck.Add(mainkeys);
                    int statu = 0;
                    var list = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, ref statu, false, ShowErrorMode.NO);
                    if (statu != -1)
                    {
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            for (int j = 0; j < list.Count; j++)
                            {
                                string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(list[i]);
                                if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true)
                                {
                                    return;
                                }
                                listCheck.Add(mainkeys);
                         var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
                         if (localDevice != null && localDevice.IsOnline != device.IsOnline)
                         {
                             //在线状态一样的话,不需要刷新
                             localDevice.IsOnline = device.IsOnline;
                             localDevice.ReSave();
                         }
                         if (device.IsOnline == 1)
                         {
                             HdlThreadLogic.Current.RunMain(() =>
                             {
                                 dicData[mainkeys].OnlineCount += 1;
                                 dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count;
                             });
                         }
                     }, ShowErrorMode.NO);
                                var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
                                if (localDevice != null && localDevice.IsOnline != list[i].IsOnline)
                                {
                                    //在线状态一样的话,不需要刷新
                                    localDevice.IsOnline = list[i].IsOnline;
                                    localDevice.ReSave();
                                }
                                if (list[i].IsOnline == 1)
                                {
                                    dicData[mainkeys].OnlineCount += 1;
                                    dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count;
                                }
                            }
                        });
                    }
                }
            });
        }
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -353,6 +353,18 @@
                    {
                        //移除楼层
                        Common.Config.Instance.Home.FloorDics.Remove(keys);
                        if (Common.Config.Instance.Home.CurrentFloorId == keys)
                        {
                            //如果删除的是当前楼层的话
                            Common.Config.Instance.Home.CurrentFloorId = string.Empty;
                            foreach (string floorId in Common.Config.Instance.Home.FloorDics.Keys)
                            {
                                //把第一个楼层ID给它
                                Common.Config.Instance.Home.CurrentFloorId = floorId;
                                break;
                            }
                        }
                        if (Common.Room.CurrentRoom == null)
                        {
                            Common.Room.CurrentRoom = Common.Room.Lists[0];
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -549,7 +549,16 @@
                        //界面关闭
                        return;
                    }
                    Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
                    int statu = 0;
                    var list = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, ref statu, false, ShowErrorMode.NO);
                    if (statu != -1)
                    {
                        for (int i = 0; i < list.Count; i++)
                        {
                            //设置设备在线状态
                            this.ReceiveDeviceStatuPush(list[i]);
                        }
                    }
                }
            });
        }
ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
old mode 100644 new mode 100755
@@ -91,22 +91,27 @@
                //数据异常
                return;
            }
            if (this.Parent == null)
            {
                return;
            }
            HdlThreadLogic.Current.RunMain(() =>
            {
                //清空
                listView.RemoveAll();
            });
            if (dicData.Count == 0)
            {
                //关闭进度条
                this.CloseProgressBar();
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //关闭刷新特效
                    listView.EndHeaderRefreshing();
                    listView.frameTable.Height = listView.Height;
                });
                return;
            });
            if (dicData.Count == 0)
            {
                //关闭进度条
                this.CloseProgressBar();
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //关闭刷新特效
                    listView.EndHeaderRefreshing();
                    listView.frameTable.Height = listView.Height;
                });
                return;
            }
            //初始化中部控件
            this.InitMiddleFrame(dicData);
@@ -268,12 +273,13 @@
            var btnTime = rowControl.frameTable.AddMostRightView("", 200, 50);
            btnTime.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnTime.Y = btnMsg.Bottom + Application.GetRealHeight(12);
            btnTime.Text = Convert.ToDateTime(recordInfo.CreatedOnUtc).ToString("HH:mm");
            var convertTime = UserCenterLogic.ConvertUtcTimeToLocalTime(recordInfo.CreatedOnUtc);
            btnTime.Text = convertTime.ToString("HH:mm");
            rowControl.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEventOnly);
            //底线
            if (addLine == true)
            {
                rowControl.frameTable.AddBottomLine();
                rowControl.frameTable.AddBottomLine();
            }
            //已读
            if (recordInfo.IsReading == true)
ZigbeeApp/Shared/Phone/UserView/SafetyShortcutControl.cs
@@ -1,5 +1,6 @@
using System;
using Shared.Common;
using Shared.Phone.Device.CommonForm;
using Shared.Phone.UserCenter;
namespace Shared.Phone.UserView
@@ -112,9 +113,9 @@
            }
            atHome.ButtonClickEvent += (sender, e) =>
            {
                if(sender.IsSelected)
                dialog.Close();
                if (sender.IsSelected)
                {
                    dialog.Close();
                    return;
                }
                CommonPage.Loading.Start();
@@ -124,10 +125,13 @@
                    Application.RunOnMainThread(() =>
                    {
                        CommonPage.Loading.Hide();
                        dialog.Close();
                        if(result == GarrisonMode.AtHome)
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonSuccess));
                        }
                        else
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail));
                        }
                    });
@@ -148,17 +152,26 @@
            }
            withdrawGarriso.ButtonClickEvent += (sender, e) =>
            {
                dialog.Close();
                if (sender.IsSelected)
                {
                    dialog.Close();
                    return;
                }
                new System.Threading.Thread(() =>
                CommonPage.Loading.Start();
                new System.Threading.Thread(async () =>
                {
                    var result = HdlSafeguardLogic.Current.RemoveSafetyGarrison(GarrisonMode.RemoveGarrison, true);
                    var result = await HdlSafeguardLogic.Current.RemoveSafetyGarrison(GarrisonMode.RemoveGarrison, true);
                    Application.RunOnMainThread(() =>
                    {
                        dialog.Close();
                        CommonPage.Loading.Hide();
                        if (result == 1)
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonSuccess));
                        }
                        else
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonFail));
                        }
                    });
                })
                { IsBackground = true }.Start();
@@ -181,17 +194,26 @@
            }
            atHome.ButtonClickEvent += (sender, e) =>
            {
                dialog.Close();
                if (sender.IsSelected)
                {
                    dialog.Close();
                    return;
                }
                new System.Threading.Thread(() =>
                CommonPage.Loading.Start();
                new System.Threading.Thread(async () =>
                {
                    var result = HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.AtHome);
                    var result =await HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.AtHome);
                    Application.RunOnMainThread(() =>
                    {
                        dialog.Close();
                        CommonPage.Loading.Hide();
                        if (result == GarrisonMode.AtHome)
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetAtHomeGarrisonSuccess));
                        }
                        else
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail));
                        }
                    });
                })
                { IsBackground = true }.Start();
@@ -208,17 +230,26 @@
            }
            removeHome.ButtonClickEvent += (sender, e) =>
            {
                dialog.Close();
                if (sender.IsSelected)
                {
                    dialog.Close();
                    return;
                }
                new System.Threading.Thread(() =>
                CommonPage.Loading.Start();
                new System.Threading.Thread(async () =>
                {
                    var result = HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.RemoveHome);
                    var result =await  HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.RemoveHome);
                    Application.RunOnMainThread(() =>
                    {
                        dialog.Close();
                        CommonPage.Loading.Hide();
                        if (result == GarrisonMode.RemoveHome)
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetRemoveHomeGarrisonSuccess));
                        }
                        else
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail));
                        }
                    });
                })
                { IsBackground = true }.Start();
@@ -235,17 +266,26 @@
            }
            withdrawGarriso.ButtonClickEvent += (sender, e) =>
            {
                dialog.Close();
                if (sender.IsSelected)
                {
                    dialog.Close();
                    return;
                }
                new System.Threading.Thread(() =>
                CommonPage.Loading.Start();
                new System.Threading.Thread(async () =>
                {
                    var result = HdlSafeguardLogic.Current.RemoveSafetyGarrison(GarrisonMode.RemoveGarrison, true);
                    var result =await HdlSafeguardLogic.Current.RemoveSafetyGarrison(GarrisonMode.RemoveGarrison, true);
                    Application.RunOnMainThread(() =>
                    {
                        dialog.Close();
                        CommonPage.Loading.Hide();
                        if (result == 1)
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonSuccess));
                        }
                        else
                        {
                            CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonFail));
                        }
                    });
                })
                { IsBackground = true }.Start();
ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Timers;
using Shared.Common;
using Shared.Phone.Device.AC;
using ZigBee.Device;
using Shared.Phone.Device.CommonForm;
using Shared.Phone.UserCenter.DoorLock;
using System.Timers;
using Shared.Phone.Device.DeviceLogic;
using Shared.Phone.UserCenter;
using Shared.Phone.UserCenter.DoorLock;
using ZigBee.Device;
namespace Shared.Phone.UserView
{
@@ -919,6 +919,7 @@
        /// </summary>
        private void ShowFunction()
        {
            functionSceneBodyView.RemoveAll();
            //选择功能--直接从房间的devicelist中获取
            var deviceList = Room.CurrentRoom.DeviceUIList;
            if (deviceList == null)
@@ -1011,18 +1012,17 @@
                                        })
                                        { IsBackground = true }.Start();
                                        var lightView = new FunctionMainView(xx, yy);
                                        lightView.Tag = device;
                                        itemView.AddChidren(lightView);
                                        lightView.Init();
                                        lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        lightView.SetStatuText(device.GetDeviceStatu());
                                        lightView.SetDeviceName(rollerShade.DeviceEpointName);
                                        //lightView.SetStatu(true);
                                        lightView.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
                                        lightView.SetCollect(true);
                                        var functionView = new FunctionMainView(xx, yy);
                                        functionView.Tag = device;
                                        itemView.AddChidren(functionView);
                                        functionView.Init();
                                        functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        functionView.SetStatuText(device.GetDeviceStatu());
                                        functionView.SetDeviceName(rollerShade.DeviceEpointName);
                                        functionView.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
                                        functionView.SetCollect(true);
                                        lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        {
                                            (sender as Button).IsSelected = !(sender as Button).IsSelected;
                                            if ((sender as Button).IsSelected)
@@ -1079,18 +1079,21 @@
                                            }
                                        };
                                        lightView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        functionView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        {
                                            CommonPage.Instance.IsDrawerLockMode = true;
                                            var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
                                            UserView.HomePage.Instance.AddChidren(rollerShadeControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            UserView.HomePage.Instance.ScrollEnabled = false;
                                            //rollerShadeControl.action = RefreshBodyView;
                                            rollerShadeControl.Show(device, Room.CurrentRoom);
                                            rollerShadeControl.action += (curDev, curRoom) =>
                                            {
                                                ReFreshEditDeviceAction(device, curRoom, functionView);
                                            };
                                        };
                                        lightView.CollectButton.MouseUpEventHandler += collectionEvent;
                                        functionView.CollectButton.MouseUpEventHandler += collectionEvent;
                                    }
                                }
                                else if (device.CommonDevice.Type == DeviceType.OnOffOutput)
@@ -1119,27 +1122,26 @@
                                        })
                                        { IsBackground = true }.Start();
                                        var lightView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(lightView);
                                        lightView.Init();
                                        lightView.Tag = device;
                                        lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        lightView.SetStatuText(device.GetDeviceStatu());
                                        lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        lightView.IsSelected = light.OnOffStatus == 1;
                                        lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                        var functionView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(functionView);
                                        functionView.Init();
                                        functionView.Tag = device;
                                        functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        functionView.SetStatuText(device.GetDeviceStatu());
                                        functionView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        functionView.IsSelected = light.OnOffStatus == 1;
                                        functionView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                        var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
                                        if (dev == null)
                                        if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                                        {
                                            lightView.CollectButton.IsSelected = false;
                                            functionView.CollectButton.IsSelected = false;
                                        }
                                        else
                                        {
                                            lightView.CollectButton.IsSelected = true;
                                            functionView.CollectButton.IsSelected = true;
                                        }
                                        lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        {
                                            (sender as Button).IsSelected = !(sender as Button).IsSelected;
                                            if ((sender as Button).IsSelected)
@@ -1196,36 +1198,21 @@
                                            }
                                        };
                                        lightView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        functionView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        {
                                            CommonPage.Instance.IsDrawerLockMode = true;
                                            if (device.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
                                            var lightControl = new Phone.Device.Light.OnOffControl();
                                            UserView.HomePage.Instance.AddChidren(lightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            lightControl.Show(device, Room.CurrentRoom);
                                            lightControl.action += (curDev, curRoom) =>
                                            {
                                                var lightControl = new Phone.Device.Light.OnOffControl();
                                                UserView.HomePage.Instance.AddChidren(lightControl);
                                                UserView.HomePage.Instance.PageIndex += 1;
                                                //lightControl.action = RefreshBodyView;
                                                lightControl.Show(device, Room.CurrentRoom);
                                            }
                                            else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
                                            {
                                                var lightControl = new Phone.Device.Light.PlugControl();
                                                UserView.HomePage.Instance.AddChidren(lightControl);
                                                UserView.HomePage.Instance.PageIndex += 1;
                                                //lightControl.action = RefreshBodyView;
                                                lightControl.Show(device, Room.CurrentRoom);
                                            }
                                            else
                                            {
                                                var lightControl = new Phone.Device.Light.LightControl();
                                                UserView.HomePage.Instance.AddChidren(lightControl);
                                                UserView.HomePage.Instance.PageIndex += 1;
                                                //lightControl.action = RefreshBodyView;
                                                lightControl.Show(device, Room.CurrentRoom);
                                            }
                                                ReFreshEditDeviceAction(device, curRoom, functionView);
                                            };
                                        };
                                        lightView.CollectButton.MouseUpEventHandler += collectionEvent;
                                        functionView.CollectButton.MouseUpEventHandler += collectionEvent;
                                    }
                                }
                                else if (device.CommonDevice.Type == DeviceType.AirSwitch)
@@ -1254,18 +1241,17 @@
                                        })
                                        { IsBackground = true }.Start();
                                        var lightView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(lightView);
                                        lightView.Init();
                                        lightView.Tag = device;
                                        lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        lightView.SetStatuText(device.GetDeviceStatu());
                                        lightView.SetDeviceName(airSwitch.DeviceEpointName);
                                        //lightView.SetStatu(true);
                                        lightView.IsSelected = airSwitch.OnOffStatus == 1;
                                        lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                        var functionView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(functionView);
                                        functionView.Init();
                                        functionView.Tag = device;
                                        functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        functionView.SetStatuText(device.GetDeviceStatu());
                                        functionView.SetDeviceName(airSwitch.DeviceEpointName);
                                        functionView.IsSelected = airSwitch.OnOffStatus == 1;
                                        functionView.SetCollect(Room.CurrentRoom.IsCollectInRoom( device.FileName));
                                        lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        {
                                            (sender as Button).IsSelected = !(sender as Button).IsSelected;
                                            if ((sender as Button).IsSelected)
@@ -1322,17 +1308,21 @@
                                            }
                                        };
                                        lightView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        functionView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        {
                                            CommonPage.Instance.IsDrawerLockMode = true;
                                            var lightControl = new Phone.Device.Light.AirSwitchControl();
                                            UserView.HomePage.Instance.AddChidren(lightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            //lightControl.action = RefreshBodyView;
                                            lightControl.Show(device, Room.CurrentRoom);
                                            lightControl.action += (curDev, curRoom) =>
                                            {
                                                ReFreshEditDeviceAction(device, curRoom, functionView);
                                            };
                                        };
                                        lightView.CollectButton.MouseUpEventHandler += collectionEvent;
                                        functionView.CollectButton.MouseUpEventHandler += collectionEvent;
                                    }
                                }
                                else if (device.CommonDevice.Type == DeviceType.Thermostat)
@@ -1361,17 +1351,17 @@
                                        })
                                        { IsBackground = true }.Start();
                                        var lightView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(lightView);
                                        lightView.Init();
                                        lightView.Tag = device;
                                        lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        lightView.SetStatuText(device.GetDeviceStatu());
                                        lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        lightView.IsSelected = ac.currentSystemMode != 0;
                                        lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                        var functionView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(functionView);
                                        functionView.Init();
                                        functionView.Tag = device;
                                        functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        functionView.SetStatuText(device.GetDeviceStatu());
                                        functionView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        functionView.IsSelected = ac.currentSystemMode != 0;
                                        functionView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                        lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        {
                                            (sender as Button).IsSelected = !(sender as Button).IsSelected;
                                            if ((sender as Button).IsSelected)
@@ -1428,17 +1418,20 @@
                                            }
                                        };
                                        lightView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        functionView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        {
                                            CommonPage.Instance.IsDrawerLockMode = true;
                                            var lightControl = new Phone.Device.AC.ACControl();
                                            UserView.HomePage.Instance.AddChidren(lightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            //lightControl.action = RefreshBodyView;
                                            lightControl.Show(device, Room.CurrentRoom);
                                            lightControl.action += (curDev, curRoom) =>
                                            {
                                                ReFreshEditDeviceAction(device, curRoom, functionView);
                                            };
                                        };
                                        lightView.CollectButton.MouseUpEventHandler += collectionEvent;
                                        functionView.CollectButton.MouseUpEventHandler += collectionEvent;
                                    }
                                }
                                else if (device.CommonDevice.Type == DeviceType.DimmableLight)
@@ -1469,27 +1462,26 @@
                                        })
                                        { IsBackground = true }.Start();
                                        var lightView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(lightView);
                                        lightView.Init();
                                        lightView.Tag = device;
                                        lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        lightView.SetStatuText(device.GetDeviceStatu());
                                        lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        lightView.IsSelected = dimmableLight.OnOffStatus == 1;
                                        lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                        var functionView = new FunctionMainView(xx, yy);
                                        itemView.AddChidren(functionView);
                                        functionView.Init();
                                        functionView.Tag = device;
                                        functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                        functionView.SetStatuText(device.GetDeviceStatu());
                                        functionView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        functionView.IsSelected = dimmableLight.OnOffStatus == 1;
                                        functionView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                        var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
                                        if (dev == null)
                                        if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                                        {
                                            lightView.CollectButton.IsSelected = false;
                                            functionView.CollectButton.IsSelected = false;
                                        }
                                        else
                                        {
                                            lightView.CollectButton.IsSelected = true;
                                            functionView.CollectButton.IsSelected = true;
                                        }
                                        lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
                                        {
                                            (sender as Button).IsSelected = !(sender as Button).IsSelected;
                                            if ((sender as Button).IsSelected)
@@ -1546,16 +1538,19 @@
                                            }
                                        };
                                        lightView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        functionView.CardBG.MouseUpEventHandler += (sender, e) =>
                                        {
                                            CommonPage.Instance.IsDrawerLockMode = true;
                                            var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
                                            UserView.HomePage.Instance.AddChidren(dimmableLightControl);
                                            UserView.HomePage.Instance.PageIndex += 1;
                                            //dimmableLightControl.action = RefreshBodyView;
                                            dimmableLightControl.Show(device, Room.CurrentRoom);
                                            dimmableLightControl.action += (curDev, curRoom) =>
                                            {
                                                ReFreshEditDeviceAction(device, curRoom, functionView);
                                            };
                                        };
                                        lightView.CollectButton.MouseUpEventHandler += collectionEvent;
                                        functionView.CollectButton.MouseUpEventHandler += collectionEvent;
                                    }
                                }
                                else if (device.CommonDevice.Type == DeviceType.IASZone)
@@ -1571,10 +1566,9 @@
                                    lightView.SetStatuText(device.GetDeviceStatu());
                                    lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                    lightView.IsSelected = ias.iASInfo?.Alarm1 == 1;
                                    lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                    lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                    lightView.CanControl(false);
                                    var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
                                    if (dev == null)
                                    if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                                    {
                                        lightView.CollectButton.IsSelected = false;
                                    }
@@ -1632,10 +1626,9 @@
                                        lightView.SetStatuText(device.GetDeviceStatu());
                                        lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                        lightView.IsSelected = false;
                                        lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                        lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                        lightView.CanControl(false);
                                        var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
                                        if (dev == null)
                                        if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                                        {
                                            lightView.CollectButton.IsSelected = false;
                                        }
@@ -1658,11 +1651,10 @@
                                    lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                                    lightView.SetStatuText(device.GetDeviceStatu());
                                    lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                    lightView.IsSelected = dimmableLight.IsOnline == 1;
                                    lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                    lightView.IsSelected = false;
                                    lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                    lightView.CanControl(false);
                                    var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
                                    if (dev == null)
                                    if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                                    {
                                        lightView.CollectButton.IsSelected = false;
                                    }
@@ -1691,11 +1683,10 @@
                                    lightView.SetStatuText(device.GetDeviceStatu());
                                    lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                                    lightView.CanControl(false);
                                    lightView.IsSelected = device.CommonDevice.IsOnline == 1;
                                    lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
                                    //lightView.IsSelected = device.CommonDevice.IsOnline == 1;
                                    lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                                    var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
                                    if (dev == null)
                                    if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                                    {
                                        lightView.CollectButton.IsSelected = false;
                                    }
@@ -1713,6 +1704,40 @@
                        });
                    //})
                    //{ IsBackground = true }.Start();
                }
            }
        }
        /// <summary>
        /// ReFreshEditDeviceAction
        /// </summary>
        /// <param name="device"></param>
        /// <param name="curRoom"></param>
        /// <param name="functionView"></param>
        private void ReFreshEditDeviceAction(DeviceUI device, Common.Room curRoom, FunctionMainView functionView)
        {
            if (Common.Room.CurrentRoom.IsLove)
            {
                functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                functionView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                if (Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
                {
                    ShowFunction();
                }
            }
            else
            {
                if (curRoom.Id != Common.Room.CurrentRoom.Id)
                {
                    Common.Room.CurrentRoom.DeleteDevice(device.FileName);
                    ShowFunction();
                }
                else
                {
                    functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
                    functionView.SetDeviceName(device.CommonDevice.DeviceEpointName);
                    functionView.SetCollect(Room.CurrentRoom.IsCollectInRoom(device.FileName));
                }
            }
        }
@@ -1741,7 +1766,7 @@
                Height = Application.GetRealHeight(200),
                Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
                TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
                TextAlignment = TextAlignment.Center,
                TextAlignment=TextAlignment.Center,
                IsMoreLines = true
            };
            functionSceneBodyView.AddChidren(noScenceTip);
@@ -1752,6 +1777,7 @@
        /// </summary>
        private void ShowScene()
        {
            functionSceneBodyView.RemoveAll();
            //选择场景
            var sceneList = Room.CurrentRoom.SceneUIList;
            if (sceneList == null)
ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs
@@ -91,11 +91,15 @@
        /// </summary>
        public List<FanMode> fanModes = new List<FanMode> { };
        /// <summary>
        /// <para>自定义空调支持的模式(默认全关)</para>
        /// <para>自定义空调支持的模式(默认全开)</para>
        /// <para>数组索引 -> 0:制冷 1:制热 2:送风 3:除湿 4:自动</para>
        /// <para>值 -> 1:代表使用  0:代表不使用</para>
        /// </summary>
        public int[] listSupportMode = new int[5] { 0, 0, 0, 0, 0 };
        public int[] listSupportMode = new int[5] { 1, 1, 1, 1, 1 };
        /// <summary>
        /// 是否启用摆风功能 false:不使用摆风功能 true:使用摆风功能
        /// </summary>
        public bool UseSwingFunction = true;
        /// <summary>
        /// 过滤网清洗状态
@@ -189,6 +193,14 @@
        public void ReadCleanStatu()
        {
            ReadAttri(Device.Cluster_ID.Thermostat, AttriButeId.CleanStatu);
        }
        /// <summary>
        /// 获取是否启用空调摆风模式的状态(打开 或者 关闭)
        /// </summary>
        public void ReadUseSwingFunctionStatu()
        {
            ReadAttri(Device.Cluster_ID.FanControl, AttriButeId.UseAcSwingFunctionStatu);
        }
        /// <summary>
@@ -811,618 +823,5 @@
        {
            return await SetSystemModeAsync(acMode);
        }
        #region 升级空调第三方模块的接口
        #region 读取IRACC模块固件版本(APP -> Zigbee MCU)
        ///<summary >
        ///读取IRACC模块固件版本
        /// <para>reserve:0-ff</para>
        /// </summary>
        public async System.Threading.Tasks.Task<ReadACFirewareVersionResponAllData> ReadACFirewareVersionAsync(string reserve = "01")
        {
            ReadACFirewareVersionResponAllData result = null;
            if (Gateway == null)
            {
                result = new ReadACFirewareVersionResponAllData { errorMessageBase = "当前没有网关" };
                return result;
            }
            return await System.Threading.Tasks.Task.Run(async () =>
            {
                Action<string, string> action = (topic, message) =>
                {
                    var gatewayID = topic.Split('/')[0];
                    var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
                    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());
                        if (temp == null)
                        {
                            result = new ReadACFirewareVersionResponAllData { errorMessageBase = "网关错误回复,且数据是空" };
                        }
                        else
                        {
                            result = new ReadACFirewareVersionResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
                        }
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        {
                            result = new ReadACFirewareVersionResponAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
                                if (command == "0259")
                                {
                                    var tempD = new ReadACFirewareVersionResponData();
                                    tempD.Status = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
                                    if (data.Length == 82)
                                    {
                                        var firewareString = data.Substring(12);
                                        var aa = firewareString.Length;
                                        firewareVersion = firewareString;
                                        var bytes = new byte[firewareString.Length / 2];
                                        for (int i = 0; i < bytes.Length; i++)
                                        {
                                            bytes[i] = Convert.ToByte(firewareString.Substring(i * 2, 2), 16);
                                        }
                                        var firewareVersionTemp = System.Text.Encoding.ASCII.GetString(bytes);
                                        tempD.FirewareVersion = firewareVersionTemp.Replace('\0', ' ').Trim();
                                    }
                                    result = new ReadACFirewareVersionResponAllData { readACFirewareVersionResponData = tempD };
                                    System.Console.WriteLine($"UI收到通知后的主题_command:0258_{topic}");
                                }
                            }
                        }
                    }
                };
                Gateway.Actions += action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
                try
                {
                    var passData = ReadACFirewareVersionData(reserve);
                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                    var data = new JObject { { "PassData", passData } };
                    jObject.Add("Data", data);
                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
                }
                catch { }
                var dateTime = DateTime.Now;
                while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime)
                {
                    await System.Threading.Tasks.Task.Delay(10);
                    if (result != null)
                    {
                        break;
                    }
                }
                if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
                {
                    result = new ReadACFirewareVersionResponAllData { errorMessageBase = " 回复超时,请重新操作" };
                }
                Gateway.Actions -= action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
                return result;
            });
        }
        /// <summary>
        /// 读取IRACC模块固件版本
        /// </summary>
        string ReadACFirewareVersionData(string reserve)
        {
            string data = "";
            string dataLength = "05";
            string dataComand1 = "58";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "01";
            string reserveData = reserve;
            try
            {
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                    reserveData;
            }
            catch { };
            return data;
        }
        /// <summary>
        /// IRACC模块固件版本,网关反馈信息
        /// </summary>
        public ReadACFirewareVersionResponAllData readACFirewareVersionResponAllData;
        /// <summary>
        /// IRACC模块固件版本,网关反馈信息
        /// </summary>
        [System.Serializable]
        public class ReadACFirewareVersionResponAllData
        {
            /// <summary>
            /// 错误信息
            /// </summary>
            public string errorMessageBase;
            /// <summary>
            /// 网关信息错误反馈
            /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para>
            /// </summary>
            public ErrorResponData errorResponData;
            /// <summary>
            /// IRACC模块固件版本信息
            /// </summary>
            public ReadACFirewareVersionResponData readACFirewareVersionResponData;
        }
        /// <summary>
        /// IRACC模块固件版本的数据
        /// </summary>
        [System.Serializable]
        public class ReadACFirewareVersionResponData
        {
            /// <summary>
            /// 状态
            ///<para>0--成功</para>
            ///<para>1--失败</para>
            ///<para>ff--无效</para>
            /// </summary>
            public int Status;
            /// <summary>
            /// 固件版本
            /// </summary>
            public string FirewareVersion;
        }
        #endregion
        #region 升级IRACC模块通知(APP -> Zigbee MCU)
        ///<summary >
        ///升级IRACC模块通知
        /// <para>firewareVer:固件版本</para>
        /// <para>firewareSize:固件大小</para>
        /// </summary>
        public async System.Threading.Tasks.Task<ResponseAllData> UpggradeACNotificationAsync(string firewareVer, long firewareSize)
        {
            ResponseAllData result = null;
            if (Gateway == null)
            {
                result = new ResponseAllData { errorMessageBase = "当前没有网关" };
                return result;
            }
            return await System.Threading.Tasks.Task.Run(async () =>
            {
                Action<string, string> action = (topic, message) =>
                {
                    var gatewayID = topic.Split('/')[0];
                    var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
                    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());
                        if (temp == null)
                        {
                            result = new ResponseAllData { errorMessageBase = "网关错误回复,且数据是空" };
                        }
                        else
                        {
                            result = new ResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
                        }
                    }
                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
                    {
                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
                        if (gatewayTemp.clientDataPassthroughResponseData == null)
                        {
                            result = new ResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
                                var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
                                if (command == "025b")
                                {
                                    var tempD = new ResponseData();
                                    if (data.Length == 12)
                                    {
                                        tempD.status = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
                                    }
                                    result = new ResponseAllData { responseData = tempD };
                                    System.Console.WriteLine($"UI收到通知后的主题_{ topic}");
                                }
                            }
                        }
                    }
                };
                Gateway.Actions += action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
                try
                {
                    var passData = UpggradeACNotificationData(firewareVer, firewareSize);
                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                    var data = new JObject { { "PassData", passData } };
                    jObject.Add("Data", data);
                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
                }
                catch { }
                var dateTime = DateTime.Now;
                while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime)
                {
                    await System.Threading.Tasks.Task.Delay(10);
                    if (result != null)
                    {
                        break;
                    }
                }
                if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
                {
                    result = new ResponseAllData { errorMessageBase = " 回复超时,请重新操作" };
                }
                Gateway.Actions -= action;
                System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
                return result;
            });
        }
        private string firewareVersion = string.Empty;
        /// <summary>
        /// 升级IRACC模块通知返回
        /// </summary>
        string UpggradeACNotificationData(string firewareVer, long firewareSize)
        {
            string data = "";
            string dataLength = "2C";
            string dataComand1 = "5A";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "28";
            string deviceUpgradeMethod = "01";
            string firewareVersionData = "";
            string firewareSizeData = "";
            try
            {
                //固件版本
                var firewareVerBytes = System.Text.Encoding.ASCII.GetBytes(firewareVer);
                for (int i = 0; i < firewareVerBytes.Length; i++)
                {
                    var fw = Convert.ToString(firewareVerBytes[i], 16);
                    if (fw.Length == 1)
                    {
                        fw = "0" + fw;
                    }
                    firewareVersionData += fw;
                }
                var aa = firewareVersionData.Length;
                firewareVersionData = firewareVersionData.PadRight(70, '0');
                //固件尺寸
                var tempFwSize = Convert.ToString(firewareSize, 16);
                tempFwSize = tempFwSize.PadLeft(8, '0');
                for (int i = 6; i >= 0; i = i - 2)
                {
                    firewareSizeData += tempFwSize.Substring(i, 2);
                }
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                     deviceUpgradeMethod + firewareVersionData + firewareSizeData;
            }
            catch { };
            return data;
        }
        /// <summary>
        ///升级IRACC模块通知回复
        /// </summary>
        public ResponseAllData keyColorDataResponseAllData;
        [System.Serializable]
        public class ResponseAllData
        {
            /// <summary>
            /// 错误信息
            /// </summary>
            public string errorMessageBase;
            /// <summary>
            /// 网关信息错误反馈
            /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para>
            /// </summary>
            public ErrorResponData errorResponData;
            /// <summary>
            /// 升级IRACC模块通知信息
            /// </summary>
            public ResponseData responseData;
        }
        /// <summary>
        /// 升级IRACC模块通知回复(Zigbee MCU -> APP)
        /// </summary>
        [System.Serializable]
        public class ResponseData
        {
            /// <summary>
            /// 状态值
            /// <para>0--版本号不一致(可以升级</para>
            /// <para>1--版本号一致(不用升级</para>
            /// <para>2--预留(暂时不用到</para>
            /// <para>ff--无效(暂时不用到)</para>
            /// </summary>
            public int status = -1;
        }
        #endregion
        #region 设备请求APP获取升级数据 (Zigbee MCU -> APP,主动上报)
        /// <summary>
        ///设备请求APP获取升级数据(Zigbee MCU -> APP,主动上报)
        /// </summary>
        [System.Serializable]
        public class DeviceRequestUpgradeResponseData
        {
            /// <summary>
            /// 数据偏移量,每个分包偏移量+(1-43)
            /// </summary>
            public string offset = string.Empty;
            /// <summary>
            /// 数据长度len
            /// </summary>
            public int dataLength = -1;
        }
        #endregion
        #region 发升级数据到设备(APP -> Zigbee MCU)
        ///<summary >
        ///读取IRACC模块固件版本
        /// <para>reserve:0-ff</para>
        /// </summary>
        public async void UpgradeAsync(SendUpgradeData upgradeData)
        {
            if (Gateway == null)
            {
                return;
            }
            Action<string, string> action = (topic, message) => { };
            Gateway.Actions += action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
            try
            {
                string passData = "";
                if (upgradeData != null)
                {
                    passData = SendUpgrade(upgradeData);
                }
                var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                var data = new JObject { { "PassData", passData } };
                jObject.Add("Data", data);
                Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
            }
            catch { }
            Gateway.Actions -= action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
        }
        /// <summary>
        /// 发升级数据到设备
        /// </summary>
        string SendUpgrade(SendUpgradeData upgradeData)
        {
            string data = "";
            string dataLength = "";
            string dataComand1 = "5D";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "";
            string status = "";
            string offset = "";
            string upgradeDataLength = "";
            string dataString = "";
            try
            {
                var len = 4 + 1 + 4 + 1 + upgradeData.dataLength;
                dataLength = Convert.ToString(len, 16);
                if (dataLength.Length == 1)
                {
                    dataLength = "0" + dataLength;
                }
                addDataLength = Convert.ToString(6 + upgradeData.dataLength, 16);
                if (addDataLength.Length == 1)
                {
                    addDataLength = "0" + addDataLength;
                }
                if (upgradeData.status == 0)
                {
                    status = "00";
                }
                else if (upgradeData.status == 1)
                {
                    status = "01";
                }
                else
                {
                    status = "ff";
                }
                offset = upgradeData.offset;
                var dl = Convert.ToString(upgradeData.dataLength, 16);
                if (dl.Length == 1)
                {
                    upgradeDataLength = "0" + dl;
                }
                else
                {
                    upgradeDataLength = dl;
                }
                for (int i = 0; i < upgradeData.databytes.Length; i++)
                {
                    var dataB = Convert.ToString(upgradeData.databytes[i], 16);
                    if (dataB.Length == 1)
                    {
                        dataB = "0" + dataB;
                    }
                    dataString += dataB;
                }
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                status + offset + upgradeDataLength + dataString;
            }
            catch { };
            return data;
        }
        /// <summary>
        /// 发送升级数据到设备(APP -> Zigbee MCU)
        /// </summary>
        [System.Serializable]
        public class SendUpgradeData
        {
            /// <summary>
            /// 0--成功
            ///<para>1--失败</para>
            ///<para>ff--无效</para>
            /// </summary>
            public int status = 0;
            /// <summary>
            /// 数据偏移量,每个分包偏移量+(1-43)
            /// </summary>
            public string offset;
            /// <summary>
            /// 数据长度len
            /// </summary>
            public int dataLength = -1;
            /// <summary>
            /// 分包数据
            /// </summary>
            public byte[] databytes;
        }
        #endregion
        #region 分包结束(Zigbee MCU -> APP,主动上报)
        /// <summary>
        /// 设备请求APP获取分包结束命令(Zigbee MCU -> APP)
        /// </summary>
        [System.Serializable]
        public class DeviceRequestFinishResponseData
        {
            /// <summary>
            /// 0-ff
            /// </summary>
            public int reserve = -1;
        }
        #endregion
        #region 分包结束(APP -> Zigbee MCU)
        ///<summary >
        ///读取IRACC模块固件版本
        /// <para>status:0--成功;1--失败;ff--无效 .</para>
        /// </summary>
        public async void SendFinishAsync(int status)
        {
            if (Gateway == null)
            {
                return;
            }
            Action<string, string> action = (topic, message) => { };
            Gateway.Actions += action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 启动" + System.DateTime.Now.ToString());
            try
            {
                var passData = SendFinishDataString(status);
                var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
                var data = new JObject { { "PassData", passData } };
                jObject.Add("Data", data);
                Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
            }
            catch { }
            Gateway.Actions -= action;
            System.Console.WriteLine("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
        }
        /// <summary>
        /// 发升级数据到设备
        /// </summary>
        string SendFinishDataString(int status)
        {
            string data = "";
            string dataLength = "05";
            string dataComand1 = "5F";
            string dataComand2 = "02";
            string dataSerialNum = "01";
            string addDataLength = "01";
            string statusString = "";
            try
            {
                if (status == 0)
                {
                    statusString = "00";
                }
                else if (status == 1)
                {
                    statusString = "01";
                }
                else
                {
                    statusString = "ff";
                }
                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
                statusString;
            }
            catch { };
            return data;
        }
        /// <summary>
        /// 分包结束返回(APP -> Zigbee MCU
        /// </summary>
        //[System.Serializable]
        public class SendFinishData
        {
            /// <summary>
            /// 状态:成功/失败
            ///<para>0--成功<<para>
            ///<para>1--失败<<para>
            ///<para>ff--无效<<para>
            /// </summary>
            public int status = -1;
        }
        #endregion
        #endregion
    }
}
ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs
@@ -267,7 +267,11 @@
        /// <summary>
        /// 过虑网清洗标志:42
        /// </summary>
        CleanStatu = 4097,
        CleanStatu = 4097,
        /// <summary>
        /// 启用空调摆风模式的状态(打开 或者 关闭)
        /// </summary>
        UseAcSwingFunctionStatu = 4097,
        #endregion
ZigbeeApp/Shared/R.cs
@@ -901,10 +901,10 @@
        /// 编辑
        /// </summary>
        public const int Edit = 11011;
        /// <summary>
        /// 设置功能
        /// </summary>
        public const int FunctionSetting = 11012;
        /// <summary>
        /// 功能设置
        /// </summary>
        public const int FunctionSetting = 11012;
        /// <summary>
        /// 信息编辑
        /// </summary>
@@ -1001,6 +1001,11 @@
        /// 添加延时
        /// </summary>
        public const int AddDelayTime = 11036;
        /// <summary>
        /// 空调模式为空,请先配置
        /// </summary>
        public const int AC_Model_None = 11037;
        #region  设备类型
        /// <summary>
@@ -5274,6 +5279,18 @@
        /// 办公室
        /// </summary>
        public const int uWorkRoom = 16060;
        /// <summary>
        /// 电机数据异常,请重置电机
        /// </summary>
        public const int uCurtainDataIsErrorPleaseResetCurtain = 16061;
        /// <summary>
        /// 获取空调摆风状态失败
        /// </summary>
        public const int uGetAirConditionerSwingFunctionFail = 16062;
        /// <summary>
        /// 设置空调摆风失败
        /// </summary>
        public const int uSetAirConditionerSwingFunctionFail = 16063;
        //★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
ZigbeeApp/Shared/Shared.projitems
@@ -9,7 +9,6 @@
    <Import_RootNamespace>Shared</Import_RootNamespace>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="$(MSBuildThisFileDirectory)Common\ComparerDeviceUI.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Common\Device.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Common\House.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Common\Logic.cs" />