| | |
| | | } |
| | | |
| | | /// <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> |