From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs index 1f1c62e..5d8ca7d 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs @@ -354,10 +354,6 @@ { device = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmerSwitch>(strDeviceByte); } - else if (intDeviceType == (int)DeviceType.Airer) - { - device = Newtonsoft.Json.JsonConvert.DeserializeObject<Airer>(strDeviceByte); - } else { device = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice>(strDeviceByte); @@ -482,7 +478,7 @@ //鍏朵粬鐨勫浘鏍囨湁鐐圭壒娈� string unSelectPic = string.Empty; string selectPic = string.Empty; - Shared.Common.LocalDevice.Current.GetDeviceObjectIcon(new List<CommonDevice> { this }, ref unSelectPic, ref selectPic); + Shared.Phone.HdlDeviceCommonLogic.Current.GetDeviceObjectIcon(new List<CommonDevice> { this }, ref unSelectPic, ref selectPic); IconPath = unSelectPic; } Shared.Common.Global.WriteFileByBytesByHomeId(FilePath, System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this))); @@ -1306,11 +1302,12 @@ /// 璁剧疆鍙啓灞炴�х殑鍊� /// </summary> /// <returns>The writable value async.</returns> + /// <param name="gateway">Gateway.</param> /// <param name="clusterID">瑕侀厤缃殑灞炴�ф墍鍦ㄧ殑cluster.</param> /// <param name="setWritableValue">璁剧疆鍙啓灞炴�х殑鏁版嵁</param> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetWritableValueAsync(int clusterID, SetWritableValueData setWritableValue) + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetWritableValueAsync(ZigBee.Device.ZbGateway gateway, int clusterID, SetWritableValueData setWritableValue) { - if (Gateway == null || setWritableValue == null) + if (gateway == null || setWritableValue == null) { return null; } @@ -1351,7 +1348,7 @@ } } }; - Gateway.Actions += action; + gateway.Actions += action; System.Console.WriteLine("SetWritableValue_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); try @@ -1359,7 +1356,7 @@ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", clusterID }, { "Command", 120 } }; var data = new JObject { { "Undivided", setWritableValue.Undivided }, { "AttributeId", setWritableValue.AttributeId }, { "AttributeDataType", setWritableValue.AttributeDataType }, { "AttributeData", setWritableValue.AttributeData } }; jObject.Add("Data", data); - Gateway.Send("SetWritableValue", jObject.ToString()); + gateway.Send("SetWritableValue", jObject.ToString()); } catch { } @@ -1376,7 +1373,7 @@ { d = new SetWritableValueResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } - Gateway.Actions -= action; + gateway.Actions -= action; System.Console.WriteLine("SetWritableValue_Actions 閫�鍑�" + System.DateTime.Now.ToString()); return d; -- Gitblit v1.8.0