fixes issues

This commit is contained in:
mohammad
2024-11-27 14:23:00 +03:00
parent 80d92de625
commit 51b1438d0e
15 changed files with 405 additions and 810 deletions

View File

@ -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;
}
}