HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-04 c7698e163e43cea9e7f8ee45f8e3f91c9265cca4
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -170,11 +170,11 @@
                CommonPage.Loading.Start("");
                #region 数据处理
                var tempDeata = await currentKey.ReadPanelConfigureInfoAsync();
                if (tempDeata != null && tempDeata.deviceStatusReportData != null)
                {
                    currentClusterID = tempDeata.deviceStatusReportData.CluterID;
                    //if (currentClusterID == 6)
                    //{
                    foreach (var attr in tempDeata.deviceStatusReportData.AttriBute)
                    {
                        currentKey.panelMode = attr.AttriButeData;
@@ -183,44 +183,76 @@
                        var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
                        var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
                        if (getBindList != null)
                        if (getBindList != null && getBindList.getAllBindResponseData != null)
                        {
                            if (getBindList.getAllBindResponseData != null)
                            foreach (var b in getBindList.getAllBindResponseData.BindList)
                            {
                                foreach (var b in getBindList.getAllBindResponseData.BindList)
                                if (b.BindCluster == currentClusterID)
                                {
                                    if (b.BindCluster == currentClusterID)
                                    if (b.BindCluster == 6)
                                    {
                                        if (b.BindCluster == 6)
                                        {
                                            if (b.BindType == 2)
                                            {
                                                bindSceneListTemp.Add(b);
                                            }
                                            else
                                            {
                                                bindDeviceListTemp.Add(b);
                                            }
                                        if (b.BindType == 2)
                                        {
                                            bindSceneListTemp.Add(b);
                                        }
                                        else
                                        {
                                            currentKey.bindList.Add(b);
                                            bindDeviceListTemp.Add(b);
                                        }
                                    }
                                    else
                                    {
                                        currentKey.bindList.Add(b);
                                    }
                                }
                            }
                        }
                        else
                        {
                            var btn = new Button()
                            {
                                Gravity = Gravity.Center,
                            };
                            this.midFrameLayout.AddChidren(btn);
                            Application.RunOnMainThread(() =>
                            {
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btn);
                            });
                        }
                        if (currentKey.panelMode == 1)
                        {
                            currentKey.bindList = bindSceneListTemp;
                            currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddScene);
                        }
                        else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102)
                        {
                            currentKey.bindList = bindDeviceListTemp;
                            currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddSwitch);
                        }
                        else if (currentKey.panelMode == 200 || currentKey.panelMode == 201 || currentKey.panelMode == 202 || currentKey.panelMode == 203 || currentKey.panelMode == 204 || currentKey.panelMode == 205)
                        {
                            currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddDimmer);
                        }
                        else if (currentKey.panelMode == 300 || currentKey.panelMode == 301 || currentKey.panelMode == 302 || currentKey.panelMode == 303 || currentKey.panelMode == 304)
                        {
                            currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddCurtain);
                        }
                    }
                    #endregion 
                }
                else
                {
                    Application.RunOnMainThread(() =>
                    {
                        var btn = new Button()
                        {
                            Gravity = Gravity.Center,
                        };
                        this.midFrameLayout.AddChidren(btn);
                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btn);
                    });
                }
            }
            catch
@@ -296,20 +328,6 @@
                midVerticalScrolViewLayout.Y = topMidVerticalScrolViewLayout.Bottom;
                midVerticalScrolViewLayout.Height = this.midFrameLayout.Height;
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout;
                //var tempDeata = await currentKey.ReadPanelConfigureInfoAsync();
                //if (tempDeata != null && tempDeata.deviceStatusReportData != null)
                //{
                //    currentClusterID = tempDeata.deviceStatusReportData.CluterID;
                //    if (currentClusterID == 6)
                //    {
                //        foreach (var attr in tempDeata.deviceStatusReportData.AttriBute)
                //        {
                //            curModeId = attr.AttriButeData;
                //            currentKey.panelMode = curModeId;
                //        }
                //    }
                //}
                if (currentKey.panelMode == 1)
                {
@@ -568,8 +586,8 @@
                        RefreshList();
                        //如果是场景,用户删除清空当前到房间列表
                        currentKey.RoomId = "";
                        currentKey.ReSave();
                    }
                    CommonPage.Loading.Hide();
                }
@@ -679,7 +697,6 @@
                       currentKey.currentKeySelectModeText = btnMethodText.Text;
                       oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                   }
                   if (currentKey.currentKeySelectModeText == Language.StringByID(R.MyInternationalizationString.AddScene))
                   {
                       if (currentKey.bindList.Count != 0)
@@ -1000,6 +1017,7 @@
                                RefreshList();
                                //如果是场景,用户删除清空当前到房间列表
                                currentKey.RoomId = "";
                                currentKey.ReSave();
                                return 0;
                                break;
                            case 1: