2023年09月11日14:15:05
修复海信设备在线离线bug
| | |
| | | public bool online { |
| | | get |
| | | { |
| | | if (spk == SPK.AirSwitchP3) |
| | | if (spk == SPK.AirSwitchP3|| spk == SPK.ElectricalTvHisense) |
| | | { |
| | | return _online; |
| | | } |
| | |
| | | { |
| | | var list =CommonMethod.Current.GetVideoDoorLockList(); |
| | | var form = new VideoDoorLockListPage(()=> { |
| | | functionContentView?.RemoveFromParent(); |
| | | this.RefreshFunctionView(); |
| | | UpdateBottomView(); |
| | | }); |
| | | form.AddForm(list); |
| | | }; |
| | |
| | | { |
| | | var list = HDL_ON.UI.UI2.FuntionControlView.Aks.AksCommonMethod.Current.GetVideoControlsList(); |
| | | var form = new HDL_ON.UI.UI2.FuntionControlView.Aks.AksListPage(() => { |
| | | functionContentView?.RemoveFromParent(); |
| | | this.RefreshFunctionView(); |
| | | UpdateBottomView(); |
| | | }); |
| | | form.AddForm(list); |
| | | }; |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | skipView.DelAction += () => |
| | | { |
| | | functionContentView?.RemoveFromParent(); |
| | | this.RefreshFunctionView(); |
| | | |
| | | UpdateBottomView(); |
| | | }; |
| | | }; |
| | | } |
| | |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | //如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | contentView.AddChidren(delTextBtn); |
| | | } |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> ClickEvent = (sener, e) => |
| | | { |
| | |
| | | //初始化事件 |
| | | this.EventListener(); |
| | | //读取数据 |
| | | //this.ReadData(); |
| | | this.ReadData(); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | if (this.device == null) |
| | | { |
| | | //设备不在线控制失败 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonMethod.Current.ShowTip(Language.StringByID(StringId.shebeibuzaixian), 3); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | if (!this.device.online) |
| | | { |
| | | //设备不在线控制失败 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonMethod.Current.ShowTip(Language.StringByID(StringId.shebeibuzaixian), 3); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | dic.Add(key, value); |
| | | Send.Current.SendControlCommand(this.device, dic, action); |
| | |
| | | /// </summary> |
| | | private void ReadData() |
| | | { |
| | | if (this.device == null) |
| | | { |
| | | return; |
| | | } |
| | | CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | | |
| | | var isRefreshDeviceStatus = Send.Current.RefreshDeviceStatus(new List<string> { this.device.deviceId }); |
| | | if (isRefreshDeviceStatus) |
| | | { |
| | | }); |
| | | var fun = Send.Current.GetDeviceInfo(this.device.deviceId); |
| | | if (fun != null) |
| | | { |
| | | //更新真实在线状态 |
| | | this.device.online = fun.online; |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新设备状态 |
| | | /// </summary> |
| | | /// <param name="tipType">是否需要提示,默认提示</param> |
| | | /// <returns></returns> |
| | | public bool RefreshDeviceStatus(List<string> functionIds, TipType tipType = TipType.flicker) |
| | | { |
| | | try |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", functionIds); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus, "刷新设备状态"); |
| | | if (!this.DataChecking(responsePackNew, tipType)) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | catch |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取设备详情 |
| | | /// </summary> |
| | | /// <param name="tipType">是否需要提示,默认提示</param> |
| | | /// <returns></returns> |
| | | public Function GetDeviceInfo(string functionId, TipType tipType = TipType.flicker) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", new List<string>() { functionId }); |
| | | |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GetDevcieInfoList, "获取设备详情"); |
| | | if (!this.DataChecking(responsePackNew, tipType)) |
| | | { |
| | | return null; |
| | | } |
| | | var functionList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Function>>(responsePackNew.Data.ToString()); |
| | | if (functionList != null && functionList.Count > 0) |
| | | { |
| | | return functionList[0]; |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | ///删除设备 |
| | | /// </summary> |
| | | /// <param name="deviceId">设备id</param> |