| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="doorLock"></param> |
| | | public AddScenePage(ZigBee.Device.Panel key, List<ScenesListInfo> gwScenesList) |
| | | public AddScenePage(ZigBee.Device.Panel key) |
| | | { |
| | | this.currentKey = key; |
| | | gwCurScenesList = gwScenesList; |
| | | } |
| | | |
| | | #region 变量申明 |
| | |
| | | /// </summary> |
| | | Dictionary<string, string> dicFloor; |
| | | List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>(); |
| | | /// <summary> |
| | | /// 网关中的场景列表 |
| | | /// </summary> |
| | | public List<ScenesListInfo> gwCurScenesList = new List<ScenesListInfo>(); |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | if (currentKey.bindList.Count != 0) |
| | | { |
| | | var bindResult = await currentKey.ClearBindInfoAsync(); |
| | | var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey); |
| | | if (bindResult != null && bindResult.clearBindInfoResponseData != null) |
| | | { |
| | | if (bindResult.clearBindInfoResponseData.Result != 0) |
| | |
| | | } |
| | | } |
| | | |
| | | var temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Scene_Trigger); |
| | | var temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Scene_Trigger); |
| | | if (temp == null || temp.setWritableValueResponData == null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | |
| | | } |
| | | |
| | | var dev = new AddedDeviceBindResponseAllData(); |
| | | dev = await currentKey.AddDeviceBindAsync(addBindeDev); |
| | | dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev); |
| | | if (dev != null && dev.addedDeviceBindResponseData != null) |
| | | { |
| | | if (dev.addedDeviceBindResponseData.Result == 0) |
| | |
| | | { |
| | | continue; |
| | | } |
| | | var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == sceneId)); |
| | | if (gwSc != null) |
| | | { |
| | | tempSceneUIList.Add(scene); |
| | | } |
| | | tempSceneUIList.Add(scene); |
| | | } |
| | | return tempSceneUIList; |
| | | } |