From d87400af518ebc9274f4447f06476959c3aa5102 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 14 七月 2020 16:29:42 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into dev-2020xm
---
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs
index 470479a..e0c6eb5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs
@@ -52,7 +52,7 @@
}
/// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭� 鈽嗏槅鈽嗏槅鈽�
/// </summary>
private void InitMiddleFrame()
{
@@ -106,7 +106,7 @@
var btnOk = new BottomClickButton();
btnOk.TextID = R.MyInternationalizationString.uSave;
bodyFrameLayout.AddChidren(btnOk);
- btnOk.ButtonClickEvent += async (sender, e) =>
+ btnOk.ButtonClickEvent += (sender, e) =>
{
if (this.oldReportValue == this.reportValue)
{
@@ -116,13 +116,13 @@
}
//灏嗕簩杩涘埗杞崲涓哄崄杩涘埗
var data = Convert.ToInt32(this.fixValue + this.reportValue, 2);
- var result = await HdlDeviceAirConditionerLogic.Current.SetAcModeSupport(deviceAc, data);
+ var result = HdlDeviceAirConditionerLogic.Current.SetAcModeSupport(deviceAc, data);
if (result == true)
{
//鏇存敼缂撳瓨
for (int i = 0; i < this.reportValue.Length; i++)
{
- deviceAc.listSupportMode[i] = Convert.ToInt32(reportValue[i]);
+ deviceAc.listSupportMode[i] = Convert.ToInt32(reportValue[i].ToString());
}
deviceAc.ReSave();
this.CloseForm();
@@ -181,12 +181,25 @@
#region 鈻� 璇诲彇绌鸿皟鑷畾涔夋ā寮廮________________
/// <summary>
- /// 璇诲彇绌鸿皟鑷畾涔夋ā寮�
+ /// 璇诲彇绌鸿皟鑷畾涔夋ā寮� 鈽嗏槅鈽嗏槅鈽�
/// </summary>
private void ReadAirConditionerModeSupport()
{
+ //濡傛灉鏄櫄鎷熶綇瀹�
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ var data = ModelData.DeviceModelDataLogic.Current.GetAcModeSupport(deviceAc);
+ //杞崲涓轰簩杩涘埗
+ var value = Convert.ToString(data, 2).PadLeft(16, '0');
+ //杩欎簲涓缃槸鏀惧湪鍚庨潰鐨�
+ this.fixValue = value.Substring(0, value.Length - 5);
+ this.reportValue = value.Substring(this.fixValue.Length);
+ oldReportValue = reportValue;
+ return;
+ }
+
string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(deviceAc);
- HdlDeviceAttributeLogic.Current.AddAttributeEvent("ReadAirConditionerModeSupport", "DeviceStatusReport", (report) =>
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("ReadAirConditionerModeSupport", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
{
string checkKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
if (checkKeys != mainkeys || report.DeviceStatusReport.CluterID != 513)
@@ -198,7 +211,7 @@
var data = report.DeviceStatusReport.AttriBute[i];
if (data.AttributeId == 4099)
{
- HdlDeviceAttributeLogic.Current.RemoveEvent("ReadAirConditionerModeSupport");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("ReadAirConditionerModeSupport");
//杞崲涓轰簩杩涘埗
var value = Convert.ToString(data.AttriButeData, 2).PadLeft(16, '0');
//杩欎簲涓缃槸鏀惧湪鍚庨潰鐨�
@@ -219,11 +232,11 @@
/// <summary>
/// 鐣岄潰鍏抽棴
/// </summary>
- public override void CloseForm()
+ public override void CloseFormBefore()
{
- HdlDeviceAttributeLogic.Current.RemoveEvent("ReadAirConditionerModeSupport");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("ReadAirConditionerModeSupport");
- base.CloseForm();
+ base.CloseFormBefore();
}
#endregion
--
Gitblit v1.8.0