| | |
| | | } |
| | | if (deviceUI.CommonDevice.Type == DeviceType.DimmableLight) |
| | | { |
| | | if ((common as DimmableLight).DeviceStatusReport.CluterID == 6) |
| | | if (common.DeviceStatusReport.CluterID == 6) |
| | | { |
| | | dimmableLight = deviceUI.CommonDevice as DimmableLight; |
| | | dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport; |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | //记录、更新状态 |
| | | if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) |
| | | { |
| | |
| | | { |
| | | levelSeekBar.IsClickable = true; |
| | | levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor; |
| | | //levelSeekBar.Progress = 100; |
| | | } |
| | | else |
| | | { |
| | | levelSeekBar.IsClickable = false; |
| | | levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor; |
| | | //levelSeekBar.Progress = 0; |
| | | } |
| | | //change color |
| | | dimmableLight.LastDateTime = DateTime.Now; |
| | | } |
| | | //亮度 |
| | | if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8) |
| | | if (common.DeviceStatusReport.CluterID == 8) |
| | | { |
| | | dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; |
| | | dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; |
| | | if (attriButeList == null || attriButeList.Count == 0) |
| | | { |
| | |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) |
| | | Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1) |
| | | }; |
| | | itemView.AddChidren(StatuBtn); |
| | | |
| | |
| | | }; |
| | | itemView.AddChidren(levelSeekBar); |
| | | |
| | | if (dimmableLight.OnOffStatus==1) |
| | | if (dimmableLight.OnOffStatus == 1) |
| | | { |
| | | levelSeekBar.IsClickable = true; |
| | | levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor; |
| | |
| | | |
| | | levelSeekBar.OnProgressChangedEvent += (send2, e2) => |
| | | { |
| | | dimmableLight.SetLevel((int)(levelSeekBar.Progress*MaxLevel/100.0)); |
| | | dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); |
| | | }; |
| | | |
| | | switchBtn = new Button() |