xm
2020-04-29 07466c19110693e3e439a7d7c8ad0bc21d9b3287
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.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,15 @@
            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);
@@ -112,10 +122,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.SendLightStatuComand(this.device);
            }
        }