mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 22:37:55 +00:00
Implemented smart door animation
This commit is contained in:
@@ -46,6 +46,17 @@ class DevicesAPI {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<bool> openDoorLock(String deviceId) async {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.openDoorLock.replaceAll('{doorLockUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
return json['success'] ?? false;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future<List<DevicesCategoryModel>> fetchGroups(String spaceId) async {
|
||||
// Map<String, dynamic> params = {"homeId": spaceId, "pageSize": 100, "pageNo": 1};
|
||||
|
||||
@@ -69,17 +80,13 @@ class DevicesAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> renamePass({
|
||||
required String name,
|
||||
required String doorLockUuid,
|
||||
required String passwordId}) async {
|
||||
static Future<Map<String, dynamic>> renamePass(
|
||||
{required String name, required String doorLockUuid, required String passwordId}) async {
|
||||
final response = await _httpService.put(
|
||||
path: ApiEndpoints.renamePassword
|
||||
.replaceAll('{doorLockUuid}', doorLockUuid)
|
||||
.replaceAll('{passwordId}', passwordId),
|
||||
body: {
|
||||
"name": name
|
||||
},
|
||||
body: {"name": name},
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
@@ -156,9 +163,11 @@ class DevicesAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future getTemporaryPasswords(String deviceId, ) async {
|
||||
static Future getTemporaryPasswords(
|
||||
String deviceId,
|
||||
) async {
|
||||
final response = await _httpService.get(
|
||||
path: ApiEndpoints.getTemporaryPassword.replaceAll('{doorLockUuid}', deviceId),
|
||||
path: ApiEndpoints.getTemporaryPassword.replaceAll('{doorLockUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
@@ -196,7 +205,8 @@ class DevicesAPI {
|
||||
required String effectiveTime,
|
||||
required String invalidTime,
|
||||
required String deviceId,
|
||||
List<Schedule>? scheduleList,}) async {
|
||||
List<Schedule>? scheduleList,
|
||||
}) async {
|
||||
Map<String, dynamic> body = {
|
||||
"name": name,
|
||||
"password": password,
|
||||
@@ -216,7 +226,7 @@ class DevicesAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future generateOneTimePassword({deviceId}) async {
|
||||
static Future generateOneTimePassword({deviceId}) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addOneTimeTemporaryPassword.replaceAll('{doorLockUuid}', deviceId),
|
||||
@@ -231,15 +241,12 @@ class DevicesAPI {
|
||||
}
|
||||
}
|
||||
|
||||
static Future generateMultiTimePassword({deviceId,effectiveTime,invalidTime}) async {
|
||||
static Future generateMultiTimePassword({deviceId, effectiveTime, invalidTime}) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addMultipleTimeTemporaryPassword.replaceAll('{doorLockUuid}', deviceId),
|
||||
showServerMessage: true,
|
||||
body: {
|
||||
"effectiveTime": effectiveTime,
|
||||
"invalidTime": invalidTime
|
||||
},
|
||||
body: {"effectiveTime": effectiveTime, "invalidTime": invalidTime},
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
@@ -263,5 +270,4 @@ class DevicesAPI {
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user