Implemented WPS device

This commit is contained in:
Abdullah Alassaf
2024-08-26 03:28:18 +03:00
parent d94ec25003
commit 929b72d11a
11 changed files with 561 additions and 58 deletions

View File

@ -31,7 +31,6 @@ class DevicesManagementApi {
path: ApiEndpoints.getDeviceStatus.replaceAll('{uuid}', uuid),
showServerMessage: true,
expectedResponseModel: (json) {
print('json==$json');
return DeviceStatus.fromJson(json);
},
);
@ -48,14 +47,14 @@ class DevicesManagementApi {
//deviceControl
Future<bool> deviceControl (String uuid, Status status) async {
Future<bool> deviceControl(String uuid, Status status) async {
try {
final response = await HTTPService().post(
path: ApiEndpoints.deviceControl.replaceAll('{uuid}', uuid),
body: status.toMap(),
showServerMessage: true,
expectedResponseModel: (json) {
return true;
return json['success'] ?? false;
},
);
return response;
@ -64,6 +63,4 @@ class DevicesManagementApi {
return false;
}
}
}