mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-23 09:27:56 +00:00
fixes issues
This commit is contained in:
@@ -213,11 +213,12 @@ abstract class ApiEndpoints {
|
||||
'/device/report-logs/{deviceUuid}?code={code}&startTime={startTime}&endTime={endTime}';
|
||||
static const String controlBatch = '/device/control/batch';
|
||||
static const String statusBatch = '/device/status/batch';
|
||||
static const String fourScene = '/device/{deviceUuid}/scenes';
|
||||
static const String deviceScene = '/device/{deviceUuid}/scenes';
|
||||
|
||||
static const String fourSceneByName =
|
||||
'/device/{deviceUuid}/scenes?switchName={switchName}';
|
||||
|
||||
static const String resetDevice = '/factory/reset/{deviceUuid}';
|
||||
static const String unAssignScenesDevice = '/factory/reset/{deviceUuid}';
|
||||
static const String unAssignScenesDevice =
|
||||
'/device/{deviceUuid}/scenes?switchName={switchName}';
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ class DevicesAPI {
|
||||
.replaceAll('{deviceUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('json==#$json');
|
||||
return json;
|
||||
},
|
||||
);
|
||||
@@ -138,11 +137,12 @@ class DevicesAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future getFourSceneInfo(String deviceId) async {
|
||||
static Future getDeviceSceneInfo(String deviceId) async {
|
||||
final response = await _httpService.get(
|
||||
path: ApiEndpoints.fourScene.replaceAll('{deviceUuid}', deviceId),
|
||||
path: ApiEndpoints.deviceScene.replaceAll('{deviceUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print(json);
|
||||
return json;
|
||||
});
|
||||
return response;
|
||||
@@ -161,14 +161,14 @@ class DevicesAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future postFourSceneInfo({
|
||||
static Future postDeviceSceneInfo({
|
||||
String? switchName,
|
||||
String? sceneUuid,
|
||||
String? deviceId,
|
||||
String? spaceUuid,
|
||||
}) async {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.fourScene.replaceAll('{deviceUuid}', deviceId!),
|
||||
path: ApiEndpoints.deviceScene.replaceAll('{deviceUuid}', deviceId!),
|
||||
body: jsonEncode(
|
||||
{
|
||||
"switchName": switchName,
|
||||
@@ -178,7 +178,6 @@ class DevicesAPI {
|
||||
),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('postFourSceneInfo=$json');
|
||||
return json;
|
||||
});
|
||||
return response;
|
||||
@@ -189,7 +188,7 @@ class DevicesAPI {
|
||||
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('json==$json');
|
||||
print('object-*-*-*${json}');
|
||||
return json;
|
||||
});
|
||||
return response;
|
||||
@@ -529,4 +528,20 @@ class DevicesAPI {
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future unAssignScenesDevice({
|
||||
String? deviceUuid,
|
||||
String? switchName,
|
||||
}) async {
|
||||
final response = await _httpService.delete(
|
||||
path: ApiEndpoints.unAssignScenesDevice
|
||||
.replaceAll('{deviceUuid}', deviceUuid!)
|
||||
.replaceAll('{switchName}', switchName!),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user