mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Implemented WPS device
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user