| | |
| | | using System.Collections.Generic; |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.Device.DeviceLogic; |
| | | using Shared.Phone.UserView; |
| | | using ZigBee.Device; |
| | | namespace Shared.Phone.Device.Light |
| | |
| | | |
| | | private Button StatuBtn; |
| | | |
| | | /// <summary> |
| | | /// IsDrawerLockMode |
| | | /// </summary> |
| | | public bool IsDrawerLockMode; |
| | | #endregion |
| | | |
| | | #region ◆ 接口__________________________ |
| | |
| | | return; |
| | | } |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; |
| | | //deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | //action(); |
| | | //action = null; |
| | | RemoveUpdateControlDeviceStatuAction(); |
| | | if (IsDrawerLockMode) |
| | | { |
| | | CommonPage.Instance.IsDrawerLockMode = false; |
| | | } |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | |
| | | { |
| | | UserHomeView.ReadStatus(light, () => |
| | | { |
| | | light.ReadOnOffStatus(); |
| | | light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //防止短时间内多次读取状态 |
| | | if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds) |
| | | { |
| | | light.ReadOnOffStatus(); |
| | | light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | var sharedBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(850), |
| | | Width = Application.GetMinReal(69), |
| | | Height = Application.GetMinReal(69), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Shared.png" |
| | | }; |
| | | top.topView.AddChidren(sharedBtn); |
| | | |
| | | var moreBtn = new Button |
| | | { |
| | |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) |
| | | Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1) |
| | | }; |
| | | itemView.AddChidren(StatuBtn); |
| | | |