| | |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appDeviceRefresh/up", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | //设备在线离线状态推送 |
| | | var deviceOnlinePush = new MqttTopicFilter() |
| | | { |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/son/session/online", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | //appRoomRefresh:房间数据刷新通知 |
| | | var appRoomRefresh = new MqttTopicFilter() |
| | | { |
| | |
| | | pirStatus,pirStudy, |
| | | appDeviceRefresh,appHomeRefresh,appRoomRefresh,residenceChange, |
| | | topicFilterPush2, topicAlinkStatus ,mqttkeyChange, |
| | | deviceOnlinePush, |
| | | securityStatusChange}); |
| | | if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) |
| | | { |
| | |
| | | var mMes = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); |
| | | //新挤下线主题方案 收到挤下线主题 |
| | | ReceiveNotifySqueezeAsync(mMes); |
| | | } |
| | | //设备在线离线状态推送 |
| | | else if(topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/son/session/online") |
| | | { |
| | | try |
| | | { |
| | | //var mMes = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); |
| | | //Newtonsoft.Json.Linq.JObject pairs = Newtonsoft.Json.Linq.JObject.Parse(mMes); |
| | | //var pairSid = pairs.GetValue("sid").ToString(); |
| | | //var pairOnline = pairs.GetValue("online"); |
| | | //if (!string.IsNullOrEmpty(pairSid.ToString())) |
| | | //{ |
| | | // var function_online = FunctionList.List.Functions.Find((obj) => obj.sid == pairSid); |
| | | // if (function_online != null){ |
| | | // function_online.online = (bool)pairOnline; |
| | | // HomePage.LoadEvent_RefreshDevcieOnline(function_online); |
| | | // FunctionPage.UpdataOnline(function_online); |
| | | // RoomPage.UpdataOnline(function_online); |
| | | // } |
| | | //} |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | //App订阅红外宝/网关遥控器添加成功通知 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/topo/found") |
| | |
| | | } |
| | | #endregion |
| | | //A网关设备状态-包含涂鸦设备 |
| | | //Tag 网络状态解析 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |