| | |
| | | var sss = Newtonsoft.Json.Linq.JObject.FromObject("sss"); |
| | | var xxx = homeJsonStr.GetValue("xxx").ToString(), |
| | | |
| | | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("Id", fId); |
| | | var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | |
| | | |
| | | */ |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("Id", fId); |
| | | var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | */ |
| | | |
| | | |
| | | string severAddress = "https://global.hdlcontrol.com/ProposedProductionApi"; |
| | |
| | | /// <summary> |
| | | /// 获取传感器历史数据 |
| | | /// </summary> |
| | | /// <param name="qType">时间查询类型:hour=近24小时、week=近一周、month = 近一月 </param> |
| | | /// <param name="qType">时间查询类型:hour=近24小时、day_hour =某日24小时、week=近一周、month = 近一月、custom_month=某年某月 y/M、custom_year=某年 y</param> |
| | | /// <param name="deviceId">设备ID</param> |
| | | /// <param name="deviceKey">功能查询类型:pm25</param> |
| | | /// <param name="time">具体查询的日期,金茂温控器使用</param> |
| | |
| | | /// 刷新Token |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string RefreshToken() |
| | | public string RefreshToken(bool canRefresh = true) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj() |
| | | { |
| | |
| | | { |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | } |
| | | #if __IOS__ |
| | | else if (revertObj.Code == "10001") |
| | | { |
| | | if (canRefresh) |
| | | { |
| | | UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | RefreshToken(false); |
| | | } |
| | | } |
| | | #endif |
| | | return revertObj.Code; |
| | | } |
| | | |
| | |
| | | if (mHomeGatewayRes.Count > 0) |
| | | { |
| | | DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];//网关状态 |
| | | DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus; |
| | | HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | return revertObj.Code; |
| | | } |
| | |
| | | var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString()); |
| | | if (mHomeGatewayRes != null) |
| | | { |
| | | DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus; |
| | | HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus; |
| | | } |
| | | } |
| | | return revertObj.Code; |
| | |
| | | deviceName = OnAppConfig.Instance.PhoneName, |
| | | deviceType = deviceType, |
| | | produce = isProduce, |
| | | |
| | | }; |
| | | mAddpushinfoObj.languageType = Utlis.GetPostLanguageType(); |
| | | |
| | |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | #region 获取天气部分 |
| | | /// <summary> |
| | | /// 获取指定经纬度的城市信息天气信息 |
| | | /// </summary> |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑设备信息 |
| | | /// 绑定关系、名称、收藏 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdataDevcieName(string deviceId,string name) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("name", name); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑设备信息 |
| | | /// 绑定关系、名称、收藏 |