| | |
| | | using static ZigBee.Device.Panel; |
| | | namespace Shared.Phone.UserCenter.Device.Bind |
| | | { |
| | | /// <summary> |
| | | /// 特殊面板的绑定界面【只能绑定特定类型,每种类型只有一个目标】 |
| | | /// </summary> |
| | | public class PaneTargetsBaseForm : BindCommonLayout |
| | | { |
| | | #region 构造函数 |
| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="device"></param> |
| | | /// <param name="deviceBindType">1:新风;2:温度传感器;3:湿度传感器;4:PM2.5传感器;5:空调目标</param> |
| | | /// <param name="deviceBindType">1:新风;2:温度传感器;3:湿度传感器;4:PM2.5传感器;5:空调目标,6:地暖目标【暂时没做,因为没有该设备,后期增加】</param> |
| | | /// <param name="bindDev">绑定目标 </param> |
| | | public PaneTargetsBaseForm(CommonDevice device, CommonDevice bindDev, DeviceBind.BindInfo.BindType deviceBindType) |
| | | { |
| | |
| | | /// 3:湿度传感器 |
| | | /// 4:PM2.5传感器 |
| | | /// 5:空调目标 |
| | | /// 6:地暖目标【暂时没做,因为没有该设备,后期增加】 |
| | | /// </summary> |
| | | DeviceBind.BindInfo.BindType curDeviceBindType = 0; |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 楼层列表 |
| | | /// </summary> |
| | | Dictionary<string, string> dicFloorList; |
| | | Dictionary<string, string> dicFloorList = new Dictionary<string, string> { }; |
| | | /// <summary> |
| | | /// 所有房间中支持被绑定的设备列表 |
| | | /// </summary> |
| | |
| | | /// Ac绑定目标回调 |
| | | /// </summary> |
| | | public Action<string> actionAcTarget = null; |
| | | |
| | | /// <summary> |
| | | /// Fh绑定目标回调 |
| | | /// </summary> |
| | | public Action<string> actionFhTarget = null; |
| | | /// <summary> |
| | | /// 是否能刷新 |
| | | /// </summary> |
| | | private bool canFresh = false; |
| | | #endregion |
| | | |
| | | #region UI设计 |
| | |
| | | //标题栏下的UI |
| | | MidFrameLayoutContent(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | InitData(); |
| | | } |
| | | |
| | |
| | | case DeviceBind.BindInfo.BindType.AC: |
| | | titleText = Language.StringByID(R.MyInternationalizationString.AcTargets); |
| | | break; |
| | | case DeviceBind.BindInfo.BindType.Fh: |
| | | titleText = Language.StringByID(R.MyInternationalizationString.uFloorHeatingTarget); |
| | | break; |
| | | } |
| | | this.TopFrameLayout(this, titleText); |
| | | EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => |
| | |
| | | /// <summary> |
| | | /// 中部UI【标题栏下的UI】 |
| | | /// </summary> |
| | | async void MidFrameLayoutContent() |
| | | void MidFrameLayoutContent() |
| | | { |
| | | var btnMidTopLayout = new FrameLayout |
| | | { |
| | |
| | | this.midFrameLayout.AddChidren(midVerticalScrolViewLayout); |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | canFresh = true; |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshing(); |
| | | InitData(); |
| | | }; |
| | |
| | | }; |
| | | this.midFrameLayout.AddChidren(bottomFrameLayout); |
| | | |
| | | var bottomTipPicFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetMinReal(40 + 44 - 10), |
| | | }; |
| | | bottomFrameLayout.AddChidren(bottomTipPicFrameLayout); |
| | | |
| | | var btnTipPicFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetMinReal(40 + 23 + 37), |
| | | Width = Application.GetMinReal(23 + 37), |
| | | Height = Application.GetMinReal(40 + 44 - 10), |
| | | X = Application.GetMinReal(383 - 37), |
| | | }; |
| | | bottomFrameLayout.AddChidren(btnTipPicFrameLayout); |
| | | bottomTipPicFrameLayout.AddChidren(btnTipPicFrameLayout); |
| | | |
| | | btnTipPic = new Button() |
| | | { |
| | | Width = Application.GetMinReal(40), |
| | | Height = Application.GetMinReal(40), |
| | | X = Application.GetMinReal(40), |
| | | Y = Application.GetRealHeight(22), |
| | | Y = Application.GetRealHeight(19), |
| | | UnSelectedImagePath = "BindPic/EmptyTargets.png", |
| | | SelectedImagePath = "BindPic/EmptyTargetsSelected.png", |
| | | }; |
| | |
| | | btnTipText = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(84 - 10), |
| | | X = Application.GetMinReal(444), |
| | | X = Application.GetMinReal(58), |
| | | Width = Application.GetMinReal(1080 - 446), |
| | | TextID = R.MyInternationalizationString.BindEmptyTargets, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,//XMTopTitleText |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | bottomFrameLayout.AddChidren(btnTipText); |
| | | bottomTipPicFrameLayout.AddChidren(btnTipText); |
| | | bottomTipPicFrameLayout.Width = btnTipPicFrameLayout.Width + Application.GetMinReal(12) + btnTipText.GetTextWidth(); |
| | | bottomTipPicFrameLayout.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | EventHandler<MouseEventArgs> eHandlerEmptyTargets = (sender, e) => |
| | | { |
| | |
| | | |
| | | btnFinifh = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(907),
|
| | | Height = Application.GetRealHeight(127),
|
| | | Width = Application.GetRealWidth(907), |
| | | Height = Application.GetRealHeight(127), |
| | | Y = Application.GetRealHeight(49 + 35), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(127) / 2, |
| | |
| | | void RefreshRoomList() |
| | | { |
| | | Room curRoom = null; |
| | | if (supportRoomList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | btnHorizontalScrolViewLayout.RemoveAll(); |
| | | Button curentOldRoom = null; |
| | | FrameLayout curentOldRoomFrameLayout = null; |
| | | int index = 0; |
| | | var roomTempList = BindInfo.GetSupportRoomList(curControlDev, supportRoomList, curDeviceBindType); |
| | | Room slectedRoom = null; |
| | | |
| | | var roomUn = new Room(); |
| | | roomUn.Name = Language.StringByID(R.MyInternationalizationString.Undistributed); |
| | | roomUn.Id = "UndistributedId"; |
| | | List<Room> roomTempList = new List<Room> { }; |
| | | if (supportRoomList.Count != 0) |
| | | { |
| | | roomTempList = BindInfo.GetSupportRoomList(curControlDev, supportRoomList, curDeviceBindType); |
| | | } |
| | | if (undistruibuteDevList.Count != 0) |
| | | { |
| | | roomTempList.Add(roomUn); |
| | |
| | | } |
| | | } |
| | | |
| | | if (index == roomTempList.Count - 1 && index > 3) |
| | | if (index == roomTempList.Count - 1 && index > 2) |
| | | { |
| | | var btnRoomFrameLayoutEmpty = new FrameLayout |
| | | { |
| | |
| | | var btn = (Button)frame.GetChildren(0); |
| | | frame.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btn.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btn; |
| | | curentOldRoomFrameLayout = frame; |
| | | } |
| | | else |
| | | { |
| | |
| | | midVerticalScrolViewLayout.RemoveAll(); |
| | | Button oldDevice = null; |
| | | int curIndex = 0; |
| | | |
| | | if (curRoom.Id == "UndistributedId") |
| | | { |
| | | currentRoomSupportBindDeviceList = BindInfo.GetUndistributeDeviceList(undistruibuteDevList, curDeviceBindType); |
| | |
| | | X = devicePic.Right + Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 15, |
| | | Text = Common.LocalDevice.Current.GetDeviceEpointName(device), |
| | | Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device), |
| | | }; |
| | | rowLayout.AddChidren(btnBindName); |
| | | |
| | |
| | | { |
| | | line2.Visible = false; |
| | | } |
| | | if (Common.LocalDevice.Current.CheckDeviceIsOnline(device) == true)
|
| | | {
|
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
|
| | | if (HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(device) == true) |
| | | { |
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack; |
| | | } |
| | | else |
| | | { |
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | } |
| | | switch (curDeviceBindType) |
| | | { |
| | |
| | | devicePic.UnSelectedImagePath = "Device/SensorTemperature.png"; |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | btnBindName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | } |
| | | break; |
| | | case DeviceBind.BindInfo.BindType.Humidity: |
| | | devicePic.UnSelectedImagePath = "Device/SensorHumidity.png"; |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | btnBindName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | } |
| | | break; |
| | | case DeviceBind.BindInfo.BindType.PM: |
| | |
| | | btnChoose.MouseUpEventHandler += hander; |
| | | curIndex++; |
| | | } |
| | | |
| | | //首次是否能点击保存 |
| | | if (targetList.Count == 0) |
| | | { |
| | | if (targetListTemp.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 初始化设备数据 |
| | | /// </summary> |
| | | void InitData() |
| | | void InitData(bool canUpdateBindName = false) |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | //获取被绑目标等信息 |
| | | BindDevInfo(curBindDevice); |
| | | |
| | | //获取楼层 |
| | | //获取楼层 |
| | | dicFloorList = HdlRoomLogic.Current.GetFloorSortList(); |
| | | //获取楼层中房间列表 |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | //获取房间列表 |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | |
| | | //获取所有房间中匹配的能绑的目标 |
| | | currentPanelSupportBindDeviceList = BindInfo.GetAllRoomSupportDeviceList(currentPanelSupportBindDeviceList, supportRoomList, curDeviceBindType); |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | canFresh = false; |
| | | midVerticalScrolViewLayout.EndHeaderRefreshing(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5007" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | |
| | | this.midFrameLayout.RemoveAll(); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | |
| | | }); |
| | | } |
| | | |
| | | targetList.Clear(); |
| | | oldTargetList.Clear(); |
| | | //选中目标列表 targetList |
| | | if (curControlDev.bindList.Count != 0) |
| | | { |
| | |
| | | var mainKey = bindDev.BindMacAddr + bindDev.BindEpoint; |
| | | |
| | | //分配的目标列表 |
| | | if (currentPanelSupportBindDeviceList.Count != 0) |
| | | if (HdlDeviceCommonLogic.Current.listAllDevice.Count != 0) |
| | | { |
| | | var dev = currentPanelSupportBindDeviceList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey)); |
| | | if (dev != null) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); |
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); |
| | | if (device != null) |
| | | { |
| | | BindTypeTargetsList(device, bindDev); |
| | |
| | | var dev = undistruibuteDevList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey)); |
| | | if (dev != null) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); |
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); |
| | | if (device != null) |
| | | { |
| | | BindTypeTargetsList(device, bindDev); |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | //楼层侧边栏绑定 |
| | | if (!canFresh) |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | } |
| | | ChooseFloorAction += (floorId, btnMethodText) => |
| | | { |
| | | btnFloorText.Text = string.Empty; |
| | | btnFloorText.Text = dicFloorList[floorId]; |
| | | //获取楼层中房间列表 |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | //获取房间列表 |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | //获取本地未分配的支持当前类型的绑定设备列表 |
| | | undistruibuteDevList = BindInfo.GetUndistributeDeviceList(undistruibuteDevList, curDeviceBindType); |
| | | RefreshRoomList(); |
| | | }; |
| | | |
| | | //默认楼层显示 |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | }); |
| | | } |
| | | |
| | | //首次是否能点击保存 |
| | | if (targetList.Count == 0) |
| | | { |
| | | curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | curControlDev.currentSelectRoomId = null; |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | }); |
| | | } |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | |
| | | //更新外面目标名字:无 |
| | | if (canUpdateBindName) |
| | | { |
| | | TargesBindName(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var dev in targetList) |
| | | { |
| | | //获取本地设备列表 |
| | | var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; |
| | | var localDeviceList = HdlDeviceCommonLogic.Current.listAllDevice; |
| | | var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == dev.DeviceAddr && obj.DeviceEpoint == dev.DeviceEpoint); |
| | | if (tempDev != null) |
| | | { |
| | |
| | | { |
| | | curControlDev.currentSelectRoomId = tempDevRoom.Id; |
| | | curControlDev.currentSelectFloorId = tempDevRoom.FloorId; |
| | | }
|
| | | else
|
| | | {
|
| | | curControlDev.currentSelectRoomId = "UndistributedId";
|
| | | } |
| | | else |
| | | { |
| | | curControlDev.currentSelectRoomId = "UndistributedId"; |
| | | } |
| | | } |
| | | |
| | | if (canUpdateBindName) |
| | | { |
| | | //更新外面目标名字:具体名字【刷新本地界面会导致外部目标变化】 |
| | | string bindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(dev); |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.Temperature: |
| | | if (dev.Type == DeviceType.PMSensor) |
| | | { |
| | | bindName += "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (dev.Type == DeviceType.PMSensor) |
| | | { |
| | | bindName += "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | } |
| | | break; |
| | | } |
| | | TargesBindName(bindName); |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(curControlDev.currentSelectFloorId)) |
| | |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | | |
| | | //获取楼层中房间列表 |
| | | if (supportRoomList.Count != 0) |
| | | { |
| | | RefreshRoomList(); |
| | | } |
| | | |
| | | CommonPage.Loading.Hide(); |
| | | RefreshRoomList(); |
| | | canFresh = false; |
| | | midVerticalScrolViewLayout.EndHeaderRefreshing(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | |
| | | if (oldTargetList.Count != 0) |
| | | if (btnTipPic.IsSelected) |
| | | { |
| | | //删除取消的目标 |
| | | foreach (var bd in oldTargetList) |
| | | //当绑定空目标,要删除已经存在按键的目标 |
| | | if (oldTargetList.Count != 0) |
| | | { |
| | | var delDevice = new DelDeviceBindData(); |
| | | delDevice.DeviceAddr = curControlDev.DeviceAddr; |
| | | delDevice.Epoint = curControlDev.DeviceEpoint; |
| | | //删除按键中已经绑定的目标个数【删除成功个数】 |
| | | int sOldTargetListCount = 0; |
| | | |
| | | var removeDevice = new RemoveBindListObj(); |
| | | removeDevice.BindType = 0; |
| | | switch (curDeviceBindType) |
| | | foreach (var bd in oldTargetList) |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | removeDevice.BindCluster = 514; |
| | | break; |
| | | case BindInfo.BindType.Temperature: |
| | | removeDevice.BindCluster = 1026; |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | removeDevice.BindCluster = 1029; |
| | | break; |
| | | case BindInfo.BindType.PM: |
| | | removeDevice.BindCluster = 1066; |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | removeDevice.BindCluster = 513;//Ac需要绑定2个簇513和514 |
| | | break; |
| | | } |
| | | removeDevice.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice); |
| | | var delDevice = DelBindDevice(bd); |
| | | |
| | | if (curDeviceBindType == BindInfo.BindType.AC) |
| | | { |
| | | //要移除空调:需要移除513,514 |
| | | var removeDevice3 = new RemoveBindListObj(); |
| | | removeDevice3.BindCluster = 514; |
| | | removeDevice3.BindType = 0; |
| | | removeDevice3.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice3.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice3); |
| | | } |
| | | //此次按键中需要移除的目标个数【同一个目标携带的多个功能删除成功的个数】 |
| | | int sRemoveBindListCount = 0; |
| | | |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | | if (delResult == null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | | if (delResult == null) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData == null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData != null) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_1" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | if (d.Result == 0 || d.Result == 1) |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData == null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData != null) |
| | | { |
| | | foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | { |
| | | EmptyTargesMess(); |
| | | if (d.Result == 0 || d.Result == 1) |
| | | { |
| | | sRemoveBindListCount++; |
| | | if (sRemoveBindListCount == delDevice.RemoveBindList.Count) |
| | | { |
| | | sOldTargetListCount++; |
| | | } |
| | | |
| | | //按键目标中的该类型个数都删除成功 |
| | | if (sOldTargetListCount == oldTargetList.Count) |
| | | { |
| | | TargesBindName(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_3" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result == 0) |
| | | { |
| | | sOldTargetListCount++; |
| | | //按键目标中的该类型个数都删除成功 |
| | | if (sOldTargetListCount == oldTargetList.Count) |
| | | { |
| | | TargesBindName(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result == 0) |
| | | { |
| | | EmptyTargesMess(); |
| | | Application.RunOnMainThread(() => |
| | | else |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | this.RemoveFromParent(); |
| | | }); |
| | | |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_2" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (btnTipPic.IsSelected) |
| | | else |
| | | { |
| | | EmptyTargesMess(); |
| | | //按键中没有目标直接绑定空目标 |
| | | TargesBindName(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //没有目标提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | |
| | | //删除已经存在的目标 |
| | | //删除情况2:按键之前已经存在的目标 |
| | | if (oldTargetList.Count != 0) |
| | | { |
| | | //删除按键中已经绑定的目标个数【删除成功个数】 |
| | | int sOldTargetListCount = 0; |
| | | |
| | | foreach (var bd in oldTargetList) |
| | | { |
| | | //此次按键中需要移除的目标个数【同一个目标携带的多个功能删除成功的个数】 |
| | | int sRemoveBindListCount = 0; |
| | | |
| | | var delDevice = DelBindDevice(bd); |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_4" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | }); |
| | | return; |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_6" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | sRemoveBindListCount++; |
| | | if (sRemoveBindListCount == delDevice.RemoveBindList.Count) |
| | | { |
| | | sOldTargetListCount++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (delResult != null && delResult.removeBindResultResponseData != null) |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result != 0) |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | if (delResult.removeBindResultResponseData.Result != 0) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_5" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | sOldTargetListCount++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //检测已经绑定的目标是否不在本地或者没有分配到任何房间中 |
| | | //此时需要删除已经被绑定到目标,才能继续绑定新目标 |
| | | if (curBindDevice != null) |
| | | { |
| | | var delDevice = DelBindDevice(curBindDevice); |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | | |
| | | if (delResult == null) |
| | | if (sOldTargetListCount != oldTargetList.Count) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData == null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData != null) |
| | | { |
| | | foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | { |
| | | if (d.Result != 0 && d.Result != 1) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (delResult != null && delResult.removeBindResultResponseData != null) |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result != 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_7" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | |
| | |
| | | addBindInfo.BindType = 0; |
| | | addBindInfo.BindMacAddr = de.DeviceAddr; |
| | | addBindInfo.BindEpoint = de.DeviceEpoint; |
| | | addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de); |
| | | addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de); |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.Temperature: |
| | | if (de.Type == DeviceType.PMSensor) |
| | | { |
| | | addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (de.Type == DeviceType.PMSensor) |
| | | { |
| | | addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | } |
| | | break; |
| | | } |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5001" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | }); |
| | | } |
| | | else |
| | |
| | | { |
| | | targetList.Clear(); |
| | | targetListTemp.Clear(); |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | if (actionFreshAirTarget != null) |
| | | { |
| | | actionFreshAirTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Temperature: |
| | | if (actionTemperatureTarget != null) |
| | | { |
| | | actionTemperatureTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (actionHumidityTarget != null) |
| | | { |
| | | actionHumidityTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.PM: |
| | | if (actionPMTarget != null) |
| | | { |
| | | actionPMTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | if (actionAcTarget != null) |
| | | { |
| | | actionAcTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | TargesBindName(addBindeDev.BindName); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindFailed), |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5001_1" + ")", |
| | | Direction = AMPopTipDirection.None, |
| | | CloseTime = 1 |
| | | }.Show(CommonPage.Instance); |
| | |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError), |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError) + "(" + "5001_2" + ")", |
| | | Direction = AMPopTipDirection.None, |
| | | CloseTime = 1 |
| | | }.Show(CommonPage.Instance); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 目标为空时的文本显示 |
| | | /// 目标为文本显示 |
| | | /// </summary> |
| | | void EmptyTargesMess() |
| | | void EmptyTargesMess1() |
| | | { |
| | | switch (curDeviceBindType) |
| | | { |
| | |
| | | break; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 目标为文本显示 |
| | | /// </summary> |
| | | void TargesBindName(string name = "") |
| | | { |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | if (actionFreshAirTarget != null) |
| | | { |
| | | actionFreshAirTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Temperature: |
| | | if (actionTemperatureTarget != null) |
| | | { |
| | | actionTemperatureTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (actionHumidityTarget != null) |
| | | { |
| | | actionHumidityTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.PM: |
| | | if (actionPMTarget != null) |
| | | { |
| | | actionPMTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | if (actionAcTarget != null) |
| | | { |
| | | actionAcTarget(name); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定目标列表 |
| | |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | //新风面板的新风设备,则不显示 |
| | | if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | if (deviceEnumInfo.ConcreteType != DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | { |
| | | if (device.Type == DeviceType.FreshAir) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | var bDev = device as TemperatureSensor; |
| | | if (bDev.SensorDiv == 1) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (bindDev.BindCluster == 1026) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | var bDev = device as TemperatureSensor; |
| | | if (bDev.SensorDiv == 2) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | if (bindDev.BindCluster == 1029) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (bindDev.BindCluster == 1066) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (bindDev.BindCluster == 513) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | targetList.Clear(); |
| | | if (oldTargetList.Count != 0) |
| | | { |
| | | targetList.Add(oldTargetList[0]); |
| | | } |
| | | |
| | | targetListTemp.Clear(); |
| | | foreach (var d in targetList) |
| | | { |
| | |
| | | return; |
| | | } |
| | | //获取本地设备列表 |
| | | var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; |
| | | var localDeviceList = HdlDeviceCommonLogic.Current.listAllDevice; |
| | | var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == bindDev.DeviceAddr && obj.DeviceEpoint == bindDev.DeviceEpoint); |
| | | if (tempDev != null) |
| | | { |
| | |
| | | removeDevice.BindCluster = 1066; |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | removeDevice.BindCluster = 513; |
| | | removeDevice.BindCluster = 513;//Ac需要绑定2个簇513和514 |
| | | break; |
| | | } |
| | | removeDevice.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice); |
| | | |
| | | if (curDeviceBindType == BindInfo.BindType.AC) |
| | | { |
| | | //要移除空调:需要移除513,514 |
| | | var removeDevice3 = new RemoveBindListObj(); |
| | | removeDevice3.BindCluster = 514; |
| | | removeDevice3.BindType = 0; |
| | | removeDevice3.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice3.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice3); |
| | | } |
| | | return delDevice; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 移除方法 |