黄学彪
2020-08-11 26d1cdf2f5246c1ad7890e6740444c4a6a80e6fb
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
@@ -604,6 +604,48 @@
        }
        #endregion
        #region ■ 校正温度___________________________
        /// <summary>
        /// 校正温度
        /// </summary>
        /// <param name="device">设备对象</param>
        /// <param name="correctValue">校正温度值</param>
        /// <param name="direction">补偿方向0不补偿 1:正向;2:反向</param>
        /// <param name="type">0 温度  ;1 湿度</param>
        /// <returns></returns>
        public async Task<bool> CorrectTemperature(CommonDevice device, double correctValue, int direction = 0, int type = 0)
        {
            //借用它的函t
            var panel = new Panel();
            panel.DeviceAddr = device.DeviceAddr;
            panel.DeviceEpoint = 200;
            panel.CurrentGateWayId = device.CurrentGateWayId;
            var result = await panel.CorrectTemperature(correctValue, direction, type);
            panel = null;
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
                return false;
            }
            if (result == null || result.responseData == null)
            {
                //矫正温度失败
                string msg = Language.StringByID(R.MyInternationalizationString.DataCorrectionFailed);
                //拼接上【网关回复超时】的Msg
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg);
                return false;
            }
            return true;
        }
        #endregion
        #region ■ 节能模式___________________________
        /// <summary>
        /// 获取设备节能模式的配置状态(ui叫节能模式)