| | |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 获取门锁历史记录 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="pageSize"></param> |
| | | /// <param name="pageNo"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetVideoDoorlockHistory(string deviceId, string pageSize, string pageNo) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("pageSize", pageSize); |
| | | d.Add("pageNo", pageNo); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取最近一个月的数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | /// 刷新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; |
| | | DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];//网关状态 |
| | | HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | return revertObj.Code; |
| | | } |
| | |
| | | public ResponsePackNew RollBack() |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("communityId", DB_ResidenceData.Instance.CurrentRegion.communityId); |
| | | d.Add("flowRecordContent", "onPro交付回滚"); |
| | | d.Add("projectFlowRecordActionEnum", "DELIVERY_ROLLBACK"); |
| | |
| | | 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; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | #region 获取天气部分 |
| | | /// <summary> |
| | | /// 获取指定经纬度的城市信息天气信息 |
| | | /// </summary> |
| | |
| | | d.Add("actions", actionObjs); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | MainPage.Log($"api功能控制:{requestJson}"); |
| | | MainPage.Log($"api发送控制:{requestJson}"); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson); |
| | | } |
| | | /// <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> |
| | | /// 编辑设备信息 |
| | | /// 绑定关系、名称、收藏 |
| | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DelTempPasswrod, requestJson); |
| | | } |
| | | |
| | | |
| | | #region 视频门锁 2023-07-07 16:47:20 |
| | | /// <summary> |
| | | /// 获取萤石门锁用户列表 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDoorlockUserList(string deviceId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorlockUserList, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改门锁用户备注 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditDoorlockUserName(string deviceId,string lockUserIndex,string remarkName) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("lockUserIndex", lockUserIndex); |
| | | d.Add("remarkName", remarkName); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_setDoorUserRemark, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除门锁用户数字密码 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="lockUserIndex"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteDoorlockUserNumberPassword(string deviceId, string lockUserIndex) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("lockUserIndex", lockUserIndex); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_NumberPassword, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除门锁用户卡密码 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="lockUserIndex"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteDoorlockUserCardPassword(string deviceId, string lockUserIndex) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("lockUserIndex", lockUserIndex); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteCardPassword, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除门锁用户指纹密码 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="lockUserIndex"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteDoorlockUserFingerPassword(string deviceId, string lockUserIndex) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("lockUserIndex", lockUserIndex); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteFingerPassword, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除门锁用户人脸密码 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="lockUserIndex"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteDoorlockUserFacePassword(string deviceId, string lockUserIndex) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("lockUserIndex", lockUserIndex); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteFacePassword, requestJson); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除门锁用户 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="lockUserIndex"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteDoorlockUser(string deviceId, string lockUserIndex) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("lockUserIndex", lockUserIndex); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteUser, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询按键两次开门 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDoubleClickOpenDoorSwitch(string deviceId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoubleClickOpenDoorSwitch, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设置按键两次开门 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="enabled">按键两次开门开关 0-关闭,1次按键开门 1-开启,2次按键开门</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetDoubleClickOpenDoorSwitch(string deviceId,int enabled) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("enabled", enabled); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoubleClickOpenDoorSwitch, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询童锁开关 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetChildLockSwitch(string deviceId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetChildLockSwitch, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设置童锁开关 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="enabled">童锁开关 0-关闭 1-开启</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetChildLockSwitch(string deviceId, int enabled) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("enabled", enabled); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetChildLockSwitch, requestJson); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查询反锁配置 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetAntiLockCfg(string deviceId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetAntiLockCfg, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设置反锁配置 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="enabled"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetAntiLockCfg(string deviceId, bool enabled) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("enabled", enabled); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetAntiLockCfg, requestJson); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查询布撤防状态 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDefenceStatus(string deviceId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDefenceStatus, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设置布撤防状态 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="armStatus">布防状态 disarmed-撤防 armed-已布防</param> |
| | | /// <param name="defenceMode">布防模式 global-全局 atHome-在家 outDoor-外出 sleep-睡眠</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetDefenceStatus(string deviceId, bool defance)//,string defenceMode) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | if(defance) |
| | | d.Add("armStatus", "armed"); |
| | | else |
| | | d.Add("armStatus", "disarmed"); |
| | | d.Add("defenceMode", "global"); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDefenceStatus, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询人脸开锁配置 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetFaceUnlockCfg(string deviceId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetFaceRecognitionUnlockCfg, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设置人脸开锁配置 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="enabled"></param> |
| | | /// <param name="mode">解锁方式 0-自动 1-手动</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetFaceUnlockCfg(string deviceId, bool enabled,int mode) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("enabled", enabled); |
| | | d.Add("mode", mode);//解锁方式 0-自动 1-手动 |
| | | d.Add("sensitivity", 0);//灵敏度 0-高 1-低 |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetFaceRecognitionUnlockCfg, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询门锁系统声音 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDoorLockSystemSound(string deviceId) |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorLockSystemSound, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置门锁系统声音 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="sound"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetDoorLockSystemSound(string deviceId,int sound) |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("sound", sound); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoorLockSystemSound, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询门铃提示音 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDoorBellTone(string deviceId) |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorBellTone, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置门铃提示音 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="volume"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SetDoorBellTone(string deviceId, int volume) |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("volume", volume); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoorBellTone, requestJson); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 音箱语言控制相关_________________________ |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取群控详情 |
| | | /// </summary> |