Temporarily disable showing the NCPS device from all the all devices api, for release and demo purposes. Feel free to revert this commit once the device is needed back into the application.

This commit is contained in:
Faris Armoush
2025-04-24 12:40:02 +03:00
parent a37236c8d2
commit ed9f98e653
2 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:convert';
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';
@ -7,6 +8,8 @@ import 'package:syncrow_app/features/devices/model/device_report_model.dart';
import 'package:syncrow_app/features/devices/model/function_model.dart';
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
import 'package:syncrow_app/services/api/http_service.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
import '../../features/devices/model/create_temporary_password_model.dart';
class DevicesAPI {
@ -580,7 +583,7 @@ class DevicesAPI {
path: path,
showServerMessage: false,
expectedResponseModel: (json) {
final data = json['data'];
final data = json['data'] as List<dynamic>?;
if (data == null || data.isEmpty) {
return <DeviceModel>[];
@ -588,9 +591,14 @@ class DevicesAPI {
if (json == null || json.isEmpty || json == []) {
return <DeviceModel>[];
}
return data
.map<DeviceModel>((device) => DeviceModel.fromJson(device))
.toList();
final result = <DeviceModel>[];
for (final device in data) {
final mappedDevice = DeviceModel.fromJson(device);
if (mappedDevice.productType?.name != DeviceType.FlushMountedSensor.name) {
result.add(mappedDevice);
}
}
return result;
},
);