This commit is contained in:
mohammad
2024-11-20 16:58:49 +03:00
parent 4b0270a70d
commit b4f990e7a9
12 changed files with 371 additions and 256 deletions

View File

@ -140,7 +140,7 @@ class DevicesAPI {
static Future getFourSceneInfo(String deviceId) async {
final response = await _httpService.get(
path: ApiEndpoints.getFourScene.replaceAll('{deviceUuid}', deviceId),
path: ApiEndpoints.fourScene.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
@ -148,6 +148,42 @@ class DevicesAPI {
return response;
}
static Future getSceneBySwitchName(
{String? deviceId, String? switchName}) async {
final response = await _httpService.get(
path: ApiEndpoints.fourSceneByName
.replaceAll('{deviceUuid}', deviceId!)
.replaceAll('{switchName}', switchName!),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
});
return response;
}
static Future postFourSceneInfo({
String? switchName,
String? sceneUuid,
String? deviceId,
String? spaceUuid,
}) async {
final response = await _httpService.post(
path: ApiEndpoints.fourScene.replaceAll('{deviceUuid}', deviceId!),
body: jsonEncode(
{
"switchName": switchName,
"sceneUuid": sceneUuid,
"spaceUuid": spaceUuid
},
),
showServerMessage: false,
expectedResponseModel: (json) {
print('postFourSceneInfo=$json');
return json;
});
return response;
}
static Future getDeviceInfo(String deviceId) async {
final response = await _httpService.get(
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),