| | |
| | | /// </summary> |
| | | List<int> typeModeList; |
| | | /// <summary> |
| | | /// 网关中的场景列表 |
| | | /// </summary> |
| | | public List<ScenesListInfo> gwScenesList = new List<ScenesListInfo>(); |
| | | /// <summary> |
| | | /// 是否支持读取 |
| | | /// </summary> |
| | | bool IsRead = false; |
| | |
| | | } |
| | | //获取本地场景列表 |
| | | 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) |
| | |
| | | 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) |
| | |
| | | { |
| | | 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(); |
| | |
| | | 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) |
| | |
| | | } |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | } |
| | | 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(); |
| | |
| | | /// <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(); |
| | |
| | | { |
| | | 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) |
| | |
| | | { |
| | | 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) |