陈嘉乐
2020-04-27 18b93d511dc764b469d7c4a7e755f7274f89cdb4
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
@@ -1,4 +1,5 @@
using System;
using Shared.Phone.UserCenter;
using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
@@ -35,6 +36,14 @@
            var btnSwitch = this.AddSwitchControl();
            btnSwitch.ButtonClickEvent += (sender, e) =>
            {
                //如果住宅为虚拟住宅,直接修改缓存
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    //直接变更缓存
                    ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1;
                    this.RefreshControlInfo(this.device);
                    return;
                }
                bool setStatu = !btnSwitch.IsSelected;
                //变更卡片状态
                this.SetRowOpenStatu(setStatu);
@@ -68,12 +77,10 @@
            //深度卡片信息
            this.frameTable.ButtonClickEvent += (sender, e) =>
            {
                var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
                UserView.HomePage.Instance.AddChidren(dimmableLightControl);
                UserView.HomePage.Instance.PageIndex += 1;
                UserView.HomePage.Instance.ScrollEnabled = false;
                dimmableLightControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
                dimmableLightControl.action += this.CardDetailInfoBackEvent;
                //彩灯,调光器类型的深度卡片界面
                var form = new MainPage.ControlForm.DeviceColorLightDetailCardForm();
                form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, 1316);
                form.FormCloseEvent += this.CardDetailInfoBackEvent;
            };
        }
@@ -100,10 +107,15 @@
        /// </summary>
        public override void SendStatuComand()
        {
            //如果住宅为虚拟住宅,此功能无效
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return;
            }
            //检测能否发送获取状态命令
            if (this.CheckCanSendStatuComand() == true)
            {
                Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
                HdlDeviceAttributeLogic.Current.SendDimmableLightStatuComand(this.device);
            }
        }