File was renamed from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs |
| | |
| | | using System.Threading.Tasks; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.UserCenter |
| | | namespace Shared.Phone |
| | | { |
| | | /// <summary> |
| | | /// 空调的逻辑 |
| | |
| | | { |
| | | var result = await device.Open(); |
| | | //检测网关返回的共通错误状态码 |
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result); |
| | | string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result); |
| | | if (error != null) |
| | | { |
| | | this.ShowTipMsg(error); |
| | |
| | | //打开空调失败 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uOpenAirConditionerFail); |
| | | //拼接上【网关回复超时】的Msg |
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result); |
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | | this.ShowTipMsg(msg); |
| | | return false; |
| | | } |
| | |
| | | { |
| | | var result = await device.Close(); |
| | | //检测网关返回的共通错误状态码 |
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result); |
| | | string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result); |
| | | if (error != null) |
| | | { |
| | | this.ShowTipMsg(error); |
| | |
| | | //关闭空调失败 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uCloseAirConditionerFail); |
| | | //拼接上【网关回复超时】的Msg |
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result); |
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | | this.ShowTipMsg(msg); |
| | | return false; |
| | | } |
| | |
| | | if (Common.Config.Instance.Home.IsVirtually == true) |
| | | { |
| | | //直接添加缓存 |
| | | TemplateData.TemplateDeviceDataLogic.Current.SetAcModeSupport(device, data, null); |
| | | HdlTemplateDeviceDataLogic.Current.SetAcModeSupport(device, data, null); |
| | | return true; |
| | | } |
| | | //发送数据 |
| | |
| | | //设置空调模式失败 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetAcModeFail); |
| | | //拼接上【网关回复超时】的Msg |
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result); |
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | | this.ShowTipMsg(msg); ; |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | //添加缓存 |
| | | TemplateData.TemplateDeviceDataLogic.Current.SetAcModeSupport(device, data, result.JsonData[0]); |
| | | HdlTemplateDeviceDataLogic.Current.SetAcModeSupport(device, data, result.JsonData[0]); |
| | | |
| | | return true; |
| | | } |
| | |
| | | if (Common.Config.Instance.Home.IsVirtually == true) |
| | | { |
| | | //直接添加缓存 |
| | | TemplateData.TemplateDeviceDataLogic.Current.SetAcSwingModeSupport(device, data, null); |
| | | HdlTemplateDeviceDataLogic.Current.SetAcSwingModeSupport(device, data, null); |
| | | return true; |
| | | } |
| | | //发送数据 |
| | |
| | | //设置空调摆风失败 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetAirConditionerSwingFunctionFail); |
| | | //拼接上【网关回复超时】的Msg |
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result); |
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result); |
| | | this.ShowTipMsg(msg); |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | //添加缓存 |
| | | TemplateData.TemplateDeviceDataLogic.Current.SetAcSwingModeSupport(device, data, result.JsonData[0]); |
| | | HdlTemplateDeviceDataLogic.Current.SetAcSwingModeSupport(device, data, result.JsonData[0]); |
| | | |
| | | return true; |
| | | } |