getDevicesBatched method

Future<List<Device>> getDevicesBatched()

Get devices using batched request (if batching is enabled)

Implementation

Future<List<Device>> getDevicesBatched() async {
  try {
    final response = await _httpService.batchedGet('/api/devices');

    if (response.statusCode == 200 && response.data != null) {
      final List<dynamic> data = response.data;
      return data.map((json) => Device.fromJson(json)).toList();
    }
    return [];
  } catch (e) {
    throw Exception('Failed to get devices: $e');
  }
}