mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Merge branch 'dev' of https://github.com/SyncrowIOT/web into feat/refactoring
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'dart:core';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_reports.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
@ -50,6 +51,22 @@ class DevicesManagementApi {
|
||||
}
|
||||
}
|
||||
|
||||
Future getPowerClampInfo(String deviceId) async {
|
||||
try {
|
||||
final response = await HTTPService().get(
|
||||
path: ApiEndpoints.powerClamp.replaceAll('{powerClampUuid}', deviceId),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
} catch (e) {
|
||||
debugPrint('Error fetching $e');
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
//deviceControl
|
||||
Future<bool> deviceControl(String uuid, Status status) async {
|
||||
try {
|
||||
@ -179,6 +196,30 @@ class DevicesManagementApi {
|
||||
}
|
||||
}
|
||||
|
||||
getPowerStatus(List<String> uuids) async {
|
||||
try {
|
||||
final queryParameters = {
|
||||
'devicesUuid': uuids.join(','),
|
||||
};
|
||||
final response = await HTTPService().get(
|
||||
path: ApiEndpoints.getBatchStatus,
|
||||
queryParameters: queryParameters,
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
} catch (e) {
|
||||
debugPrint('Error fetching $e');
|
||||
return DeviceStatus(
|
||||
productUuid: '',
|
||||
productType: '',
|
||||
status: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> addScheduleRecord(
|
||||
ScheduleEntry sendSchedule, String uuid) async {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user