| | |
| | | #define API_POST_EZ_TempList @"/home-wisdom/platform/yingshi/lock/temp/list"//萤石门临时密码列表 |
| | | #define API_POST_EZ_AddTemp @"/home-wisdom/platform/yingshi/lock/temp/add"//萤石门添加临时密码 |
| | | #define API_POST_EZ_DeleteTemp @"/home-wisdom/platform/yingshi/lock/temp/delete"//萤石门删除临时密码 |
| | | #define API_POST_EZ_DeviceMessage @"/home-wisdom/app/device/message"//萤石设备消息列表 |
| | | |
| | | #define API_POST_EZ_GetAlarmList @"/home-wisdom/platform/yingshi/alarm/records"//获取报警消息 |
| | | #define API_POST_EZ_DeleteAlarmMes @"/home-wisdom/platform/yingshi/alarm/delete"//删除报警消息 |
| | |
| | | verifyCode:(NSString *)verifyCode |
| | | completion:(void (^)(ResponseData *responseData))completion{ |
| | | |
| | | //2.设置请求参数 |
| | | //设置请求参数 |
| | | NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
| | | [parameters setValue:deviceSerial forKey:@"deviceSerial"]; |
| | | [parameters setValue:verifyCode forKey:@"validateCode"]; |
| | |
| | | |
| | | parameters = [self GetSignRequestDictionary:parameters]; |
| | | |
| | | HDLEZLog(@"添加设备参数:%@",parameters); |
| | | |
| | | |
| | | [self requestHttpsPost:API_POST_EZ_AddDevice parameters:parameters completion:^(ResponseData *responseData) { |
| | | if (responseData.success){//添加成功,触发代理 |
| | | if ([EZSDK sharedInstance].delegate&&[[EZSDK sharedInstance].delegate respondsToSelector:@selector(addDeviceSuccessed)]) { |
| | | [[EZSDK sharedInstance].delegate addDeviceSuccessed]; |
| | | } |
| | | } |
| | | |
| | | if (completion) { |
| | | completion (responseData); |
| | | } |
| | |
| | | * @since 河东门锁终端授权接口 |
| | | * @param password 门锁密码 |
| | | * @param deviceId 设备id |
| | | * @param verifyCode sdk获取的校验码 |
| | | * @param completion 回调block,error为空时表示添加成功 |
| | | * |
| | | */ |
| | | - (void)authLockByHDL:(NSString *)password |
| | | deviceId:(NSString *)deviceId |
| | | verifyCode:(NSString *)verifyCode |
| | | completion:(void (^)(ResponseData *responseData))completion{ |
| | | //2.设置请求参数 |
| | | NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
| | | [parameters setValue:deviceId forKey:@"deviceId"]; |
| | | [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; |
| | | [parameters setValue:password forKey:@"password"]; |
| | | [parameters setValue:verifyCode forKey:@"verifyCode"]; |
| | | [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; |
| | | |
| | | parameters = [self GetSignRequestDictionary:parameters]; |
| | |
| | | */ |
| | | - (void)getTempListByHDL:(NSString *)deviceId |
| | | completion:(void (^)(ResponseData *responseData))completion{ |
| | | //2.设置请求参数 |
| | | //设置请求参数 |
| | | NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
| | | [parameters setValue:deviceId forKey:@"deviceId"]; |
| | | [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * @since 河东获取设备消息 |
| | | * @param deviceId 设备id |
| | | * @param pageSize 页面大小 |
| | | * @param pageNo 当前页 |
| | | * @param completion 回调block,error为空时表示成功 |
| | | * |
| | | */ |
| | | - (void)getDeviceMessageByHDL:(NSString *)deviceId |
| | | pageSize:(NSInteger)pageSize |
| | | pageNo:(NSInteger)pageNo |
| | | completion:(void (^)(ResponseData *responseData))completion{ |
| | | //设置请求参数 |
| | | NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
| | | [parameters setValue:deviceId forKey:@"deviceId"]; |
| | | [parameters setValue:[NSString stringWithFormat:@"%ld",(long)pageSize] forKey:@"pageSize"]; |
| | | [parameters setValue:[NSString stringWithFormat:@"%ld",(long)pageNo] forKey:@"pageNo"]; |
| | | [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; |
| | | [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; |
| | | |
| | | parameters = [self GetSignRequestDictionary:parameters]; |
| | | |
| | | NSLog(@"获取设备消息参数:%@",parameters); |
| | | |
| | | [self requestHttpsPost:API_POST_EZ_DeviceMessage parameters:parameters completion:^(ResponseData *responseData) { |
| | | if (completion) { |
| | | completion (responseData); |
| | | } |
| | | }]; |
| | | } |
| | | |
| | | /// 刷新token |
| | | /// @param block 结果 |
| | | - (void)refreshHDLToken:(void (^)(BOOL isSuccess))block{ |