mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 10:06:16 +00:00
finished adding tasks and removing them , added error handling
This commit is contained in:
16
lib/features/scene/repo/scene_repo.dart
Normal file
16
lib/features/scene/repo/scene_repo.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
|
||||
import 'package:syncrow_app/services/api/devices_api.dart';
|
||||
|
||||
class SceneRepo {
|
||||
Future<bool> deviceControl({
|
||||
required DeviceControlModel controlModel,
|
||||
required String deviceId,
|
||||
}) async {
|
||||
final response = await DevicesAPI.controlDevice(controlModel, deviceId);
|
||||
if (response['success'] == true) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user