mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 08:14:55 +00:00
fixes bugs and add project id staging
This commit is contained in:
@ -51,14 +51,11 @@ class DevicesAPI {
|
||||
static Future<Map<String, dynamic>> controlDevice(
|
||||
DeviceControlModel controlModel, String deviceId) async {
|
||||
try {
|
||||
print('object-*/-*/-*/${controlModel.toJson()}');
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.controlDevice.replaceAll('{deviceUuid}', deviceId),
|
||||
body: controlModel.toJson(),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
print('object-*/-*/-*/${json}');
|
||||
|
||||
return json;
|
||||
},
|
||||
);
|
||||
@ -191,7 +188,6 @@ class DevicesAPI {
|
||||
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('object-*-*-*${json}');
|
||||
return json;
|
||||
});
|
||||
return response;
|
||||
@ -229,7 +225,7 @@ class DevicesAPI {
|
||||
.replaceAll('{communityUuid}', communityUuid)
|
||||
.replaceAll('{spaceUuid}', spaceUuid)
|
||||
.replaceAll('{subSpaceUuid}', roomId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
|
||||
final response = await _httpService.get(
|
||||
path: path,
|
||||
@ -569,21 +565,16 @@ class DevicesAPI {
|
||||
required String communityUuid,
|
||||
required String spaceUuid,
|
||||
}) async {
|
||||
print('communityUuid=$communityUuid');
|
||||
print('spaceUuid=$spaceUuid');
|
||||
print('projectUuid=${TempConst.projectId}');
|
||||
|
||||
try {
|
||||
final String path = ApiEndpoints.getAllDevices
|
||||
.replaceAll('{communityUuid}', communityUuid)
|
||||
.replaceAll('{spaceUuid}', spaceUuid)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
|
||||
final response = await _httpService.get(
|
||||
path: path,
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('response-*/-*/$json');
|
||||
final data = json['data'];
|
||||
|
||||
if (data == null || data.isEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user