HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-05-19 e747e6d8524e3146bb48dc304a713f309966b1c6
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -67,10 +67,6 @@
        /// </summary>
        List<int> typeModeList;
        /// <summary>
        /// 网关中的场景列表
        /// </summary>
        public List<ScenesListInfo> gwScenesList = new List<ScenesListInfo>();
        /// <summary>
        /// 是否支持读取
        /// </summary>
        bool IsRead = false;
@@ -95,21 +91,12 @@
                    }
                    //获取本地场景列表
                    scList = HdlSceneLogic.Current.GetAllRoomSceneList();
                    //获取网关场景表
                    if (gwScenesList.Count == 0)
                    {
                        var gwSceneObj = await currentKey.GetSceneInfoAsync();
                        if (gwSceneObj != null && gwSceneObj.getSceneInfo != null)
                        {
                            gwScenesList = gwSceneObj.getSceneInfo.ScenesList;
                        }
                    }
                    //动态获取按键支持的大类
                    typeModeList = await GetTypeMode();
                    #region 读取面板当前模式
                    //读取按键当前模式
                    var tempDeata = await currentKey.ReadPanelConfigureInfoAsync();
                    var tempDeata = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(currentKey);
                    if (tempDeata != null && tempDeata.deviceStatusReportData != null)
                    {
                        foreach (var attr in tempDeata.deviceStatusReportData.AttriBute)
@@ -136,7 +123,7 @@
                            GetDeviceBindResponseAllData getBindList = null;
                            if (IsRead)
                            {
                                getBindList = await currentKey.GetDeviceBindAsync();
                                getBindList = HdlDeviceBindLogic.Current.GetDeviceBindAsync(currentKey);
                                var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
                                var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
                                if (getBindList != null && getBindList.getAllBindResponseData != null)
@@ -270,7 +257,7 @@
                    {
                        currentClusterID = 6;
                        currentKey.panelMode = 1;
                        var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey, gwScenesList);
                        var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey);
                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addScenePage);
                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                        addScenePage.Show();
@@ -647,7 +634,7 @@
                     try
                     {
                         CommonPage.Loading.Start("");
                         var bindResult = await currentKey.ClearBindInfoAsync();
                         var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
                         if (bindResult != null && bindResult.clearBindInfoResponseData != null)
                         {
                             if (bindResult.clearBindInfoResponseData.Result != 0)
@@ -658,10 +645,10 @@
                             }
                             else
                             {
                                 var temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Default);
                                 var temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Default);
                                 if (temp != null && temp.setWritableValueResponData?.Status != 0)
                                 {
                                     var temp1 = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Default);
                                     var temp1 = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Default);
                                     if (temp1 != null && temp1.setWritableValueResponData?.Status != 0)
                                     {
                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
@@ -902,7 +889,7 @@
                                     var result = await RemoveTargets(bindSc, line2);
                                     if (result == 0)
                                     {
                                         var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey, gwScenesList);
                                         var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey);
                                         Shared.Phone.UserView.HomePage.Instance.AddChidren(addScenePage);
                                         Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                         addScenePage.Show();
@@ -925,7 +912,7 @@
                        }
                        else
                        {
                            var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey, gwScenesList);
                            var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey);
                            Shared.Phone.UserView.HomePage.Instance.AddChidren(addScenePage);
                            Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                            addScenePage.Show();
@@ -1129,6 +1116,13 @@
        /// <returns></returns>
        private async System.Threading.Tasks.Task<List<int>> GetTypeMode()
        {
            //如果当前住宅是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                //则默认全部功能都给它
                typeModeList = new List<int>() { 1, 100, 200, 300, 0, 101, 102 };
                return typeModeList;
            }
            if (typeModeList != null)
            {
                typeModeList.Clear();
@@ -1184,7 +1178,7 @@
            {
                CommonPage.Loading.Start("");
                var delResult = new DelDeviceBindResponseAllData();
                delResult = await currentKey.DelDeviceBindAsync(delDevice);
                delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
                if (delResult != null && delResult.delDeviceBindResponseData != null)
                {
                    if (delResult.delDeviceBindResponseData?.RemoveBindList != null)
@@ -1210,7 +1204,7 @@
                                    {
                                        CommonPage.Loading.Start("");
                                        var getBindList = await currentKey.GetDeviceBindAsync();
                                        var getBindList = HdlDeviceBindLogic.Current.GetDeviceBindAsync(currentKey);
                                        var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
                                        var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
                                        if (getBindList != null)