HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-12-14 e90209beae6a4e822cecb18e6889f8bda23f630e
ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -354,6 +354,10 @@
            {
                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);
@@ -478,7 +482,7 @@
                    //其他的图标有点特殊
                    string unSelectPic = string.Empty;
                    string selectPic = string.Empty;
                    Shared.Phone.HdlDeviceCommonLogic.Current.GetDeviceObjectIcon(new List<CommonDevice> { this }, ref unSelectPic, ref selectPic);
                    Shared.Common.LocalDevice.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)));
@@ -1302,12 +1306,11 @@
        /// 设置可写属性的值
        /// </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(ZigBee.Device.ZbGateway gateway, int clusterID, SetWritableValueData setWritableValue)
        public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetWritableValueAsync(int clusterID, SetWritableValueData setWritableValue)
        {
            if (gateway == null || setWritableValue == null)
            if (Gateway == null || setWritableValue == null)
            {
                return null;
            }
@@ -1348,7 +1351,7 @@
                        }
                    }
                };
                gateway.Actions += action;
                Gateway.Actions += action;
                System.Console.WriteLine("SetWritableValue_Actions 启动" + "_" + System.DateTime.Now.ToString());
                try
@@ -1356,7 +1359,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 { }
@@ -1373,7 +1376,7 @@
                {
                    d = new SetWritableValueResponAllData { errorMessageBase = " 回复超时,请重新操作" };
                }
                gateway.Actions -= action;
                Gateway.Actions -= action;
                System.Console.WriteLine("SetWritableValue_Actions 退出" + System.DateTime.Now.ToString());
                return d;