| | |
| | | light.DeviceStatusReport = common.DeviceStatusReport; |
| | | light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(light.OnOffStatus == 1); |
| | | row.IsSelected = light.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | light.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | |
| | |
| | | airSwitch.DeviceStatusReport = common.DeviceStatusReport; |
| | | airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(airSwitch.OnOffStatus == 1); |
| | | row.IsSelected = airSwitch.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | airSwitch.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | case DeviceType.WindowCoveringDevice: |
| | |
| | | rollerShade.DeviceStatusReport = common.DeviceStatusReport; |
| | | rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | row.SetStatuText($"{Language.StringByID(R.MyInternationalizationString.Current)} { deviceUI.GetDeviceStatu()}"); |
| | | row.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0; |
| | | rollerShade.LastDateTime = DateTime.Now; |
| | | } |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionForWinRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | |
| | |
| | | } |
| | | } |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(ac.currentSystemMode != 0); |
| | | row.IsSelected = ac.currentSystemMode != 0; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(ac.currentSystemMode != 0); |
| | | row.IsSelected = ac.currentSystemMode != 0; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | } |
| | | |
| | |
| | | var ac = deviceUI.CommonDevice as ZigBee.Device.AC; |
| | | ac.IsOnline = 1; |
| | | ac.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | case DeviceType.DimmableLight: |
| | |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(dimmableLight.OnOffStatus == 1); |
| | | row.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | dimmableLight.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | dimmableLight.Level = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(dimmableLight.OnOffStatus == 1); |
| | | row.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | dimmableLight.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | case DeviceType.OnOffOutput: |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case DeviceType.AirSwitch: |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row1 = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row1.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case DeviceType.WindowCoveringDevice: |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row2 = rowLayout.GetChildren(0) as CategoryFunctionForWinRow; |
| | | row2.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | break; |
| | | |
| | | case DeviceType.DimmableLight: |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row3 = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row3.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | break; |
| | | |
| | | case DeviceType.Thermostat: |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row5 = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row5.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Console.WriteLine($"分类设备状态-Error:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | else if (typeTag == "IASInfoReport") |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | for (int i = 0; deviceListScrolView != null && i < deviceListScrolView.ChildrenCount; i++) |
| | | { |
| | | var rowLayout = deviceListScrolView.GetChildren(i) as RowLayout; |
| | | var deviceUI = rowLayout.Tag as DeviceUI; |
| | | if (deviceUI == null || deviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr || deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint) |
| | | { |
| | | continue; |
| | | } |
| | | switch (deviceUI.CommonDevice.Type) |
| | | { |
| | | case DeviceType.IASZone: |
| | | //开关功能 |
| | | var ias = common as IASZone; |
| | | var iAS = deviceUI.CommonDevice as ZigBee.Device.IASZone; |
| | | iAS.iASInfo = ias.iASInfo; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.IsSelected = iAS.iASInfo?.Alarm1 == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | iAS.LastDateTime = DateTime.Now; |
| | | break; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (e2) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | if(curRoom.IsLove) |
| | | { |
| | | RefreshBodyView(); |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | //if (sameTypeList.Count == 0) |
| | | //{ |
| | | // RefreshBodyView(); |
| | | //} |
| | | } |
| | | }; |
| | | }; |
| | |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(rollerShade.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.SetStatu(rollerShade.WcdCurrentPositionLiftPercentage != 0); |
| | | deviceRow.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0; |
| | | deviceRow.SetRollerShadeIcon(rollerShade.WcdType); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |