mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
curtain wizard & bugs fixes
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
@ -60,11 +61,8 @@ class DevicesAPI {
|
||||
}
|
||||
|
||||
static Future<List<DevicesCategoryModel>> fetchGroups(String spaceId) async {
|
||||
// Map<String, dynamic> params = {"homeId": spaceId, "pageSize": 100, "pageNo": 1};
|
||||
|
||||
final response = await _httpService.get(
|
||||
path: ApiEndpoints.groupBySpace.replaceAll('{unitUuid}', spaceId),
|
||||
// queryParameters: params,
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) => DevicesCategoryModel.fromJsonList(json),
|
||||
);
|
||||
@ -72,12 +70,12 @@ class DevicesAPI {
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> getDeviceStatus(String deviceId) async {
|
||||
print(deviceId);
|
||||
final response = await _httpService.get(
|
||||
path: ApiEndpoints.deviceFunctionsStatus
|
||||
.replaceAll('{deviceUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('json======${json}');
|
||||
return json;
|
||||
},
|
||||
);
|
||||
@ -124,6 +122,7 @@ class DevicesAPI {
|
||||
return <DeviceModel>[];
|
||||
}
|
||||
List<DeviceModel> devices = [];
|
||||
|
||||
for (var device in json) {
|
||||
devices.add(DeviceModel.fromJson(device));
|
||||
}
|
||||
@ -386,13 +385,11 @@ class DevicesAPI {
|
||||
String? code,
|
||||
var value,
|
||||
}) async {
|
||||
print({"devicesUuid": devicesUuid, "code": code, "value": value});
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.controlBatch,
|
||||
body: {"devicesUuid": devicesUuid, "code": code, "value": value},
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
print('json-=-=-=-=-=-${json}');
|
||||
return json;
|
||||
},
|
||||
);
|
||||
|
Reference in New Issue
Block a user