gxc
2019-12-25 944b87b6bcccb095cd73f13f4410fb20faf48f74
ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
@@ -2,6 +2,7 @@
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
@@ -61,6 +62,11 @@
        private FrameLayout bodyFrameLayout;
        private Button StatuBtn;
        /// <summary>
        /// IsDrawerLockMode
        /// </summary>
        public bool IsDrawerLockMode;
        #endregion
@@ -160,6 +166,10 @@
            //action();
            //action = null;
            RemoveUpdateControlDeviceStatuAction();
            if (IsDrawerLockMode)
            {
                CommonPage.Instance.IsDrawerLockMode = false;
            }
            base.RemoveFromParent();
        }
@@ -197,8 +207,7 @@
            {
                UserHomeView.ReadStatus(light, () =>
                {
                    light.ReadOnOffStatus();
                    light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
                    ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
                });
            }
            else
@@ -206,8 +215,7 @@
                //防止短时间内多次读取状态
                if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
                {
                    light.ReadOnOffStatus();
                    light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
                    ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
                }
            }
@@ -242,16 +250,6 @@
            {
                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
            {
@@ -320,7 +318,7 @@
                Height = Application.GetRealHeight(60),
                Gravity = Gravity.CenterHorizontal,
                TextColor = ZigbeeColor.Current.GXCTextGrayColor,
                Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
                Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1)
            };
            itemView.AddChidren(StatuBtn);
@@ -472,7 +470,6 @@
        /// <param name="e">E.</param>
        private void Collection(object sender, MouseEventArgs e)
        {
            //collection
            if ((sender as Button).IsSelected)
            {
                Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName);