黄学彪
2019-11-07 82a773d1783549caca563831aac8affc059deedf
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs
@@ -110,6 +110,45 @@
        #endregion
        #region ■ 设置空调的自定义模式_______________
        /// <summary>
        /// 设置空调的自定义模式
        /// </summary>
        /// <param name="device">空调对象</param>
        /// <param name="data">从二进制转换的十进制值</param>
        /// <returns></returns>
        public async Task<bool> SetAcModeSupport(AC device, int data)
        {
            var result = await HdlDeviceAttributeLogic.Current.WriteDeviceAttribute(device, 513, 4099, 25, data);
            //检测网关返回的共通错误状态码
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowTipMsg(error);
                return false;
            }
            if (result == null || result.setWritableValueResponData == null)
            {
                //设置空调模式失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetAcModeFail);
                //拼接上【网关回复超时】的Msg
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg); ;
                return false;
            }
            if (result.setWritableValueResponData.Status != 0)
            {
                //设置空调模式失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetAcModeFail);
                this.ShowTipMsg(msg); ;
                return false;
            }
            return true;
        }
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>