mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 07:47:55 +00:00
Added latest changes and solved the conflicts
This commit is contained in:
@@ -92,6 +92,7 @@ abstract class ApiEndpoints {
|
||||
static const String addDeviceToRoom = '$baseUrl/device/room';
|
||||
static const String addDeviceToGroup = '$baseUrl/device/group';
|
||||
static const String controlDevice = '$baseUrl/device/{deviceUuid}/control';
|
||||
static const String firmwareDevice = '$baseUrl/device/{deviceUuid}/firmware/{firmwareVersion}';
|
||||
static const String getDevicesByUserId = '$baseUrl/device/user/{userId}';
|
||||
|
||||
//GET
|
||||
|
||||
@@ -9,6 +9,24 @@ import 'package:syncrow_app/services/api/http_service.dart';
|
||||
class DevicesAPI {
|
||||
static final HTTPService _httpService = HTTPService();
|
||||
|
||||
static Future<Map<String, dynamic>> firmwareDevice(
|
||||
{required String deviceId, required String firmwareVersion}) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.firmwareDevice
|
||||
.replaceAll('{deviceUuid}', deviceId)
|
||||
.replaceAll('{firmwareVersion}', firmwareVersion),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> controlDevice(
|
||||
DeviceControlModel controlModel, String deviceId) async {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user