From c1d9846899212b768011b828b2ec73427f48d7ae Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Wed, 9 Apr 2025 15:41:21 +0300 Subject: [PATCH] Enhance CeilingSensorHelper: Add deviceName and deviceId parameters to sensor functions --- .../ceiling_sensor/ceiling_sensor_helper.dart | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/lib/pages/routines/widgets/routine_dialogs/ceiling_sensor/ceiling_sensor_helper.dart b/lib/pages/routines/widgets/routine_dialogs/ceiling_sensor/ceiling_sensor_helper.dart index 310ca5c4..67083504 100644 --- a/lib/pages/routines/widgets/routine_dialogs/ceiling_sensor/ceiling_sensor_helper.dart +++ b/lib/pages/routines/widgets/routine_dialogs/ceiling_sensor/ceiling_sensor_helper.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart'; import 'package:syncrow_web/pages/routines/bloc/functions_bloc/functions_bloc_bloc.dart'; +import 'package:syncrow_web/pages/routines/models/ceiling_presence_sensor_functions.dart'; import 'package:syncrow_web/pages/routines/models/device_functions.dart'; import 'package:syncrow_web/pages/routines/widgets/routine_dialogs/ceiling_sensor/ceiling_sensor_dialog.dart'; @@ -33,4 +34,132 @@ abstract final class CeilingSensorHelper { ), ); } + + static List> getCeilingSensorFunctions({ + required String uuid, + required String name, + }) { + return [ + CpsRadarSwitchFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsSpatialParameterSwitchFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsSensitivityFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMovingSpeedFunction( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsSpatialStaticValueFunction( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsSpatialMotionValueFunction( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsMaxDistanceOfDetectionFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMaxDistanceOfStaticDetectionFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsDetectionRangeFunction( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsDistanceOfMovingObjectsFunction( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsPresenceJudgementThrsholdFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMotionAmplitudeTriggerThresholdFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsPerpetualBoundaryFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMotionTriggerBoundaryFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMotionTriggerTimeFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMotionToStaticTimeFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsEnteringNoBodyStateTimeFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsSelfTestResultFunctions( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsNobodyTimeFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsMovementFunctions( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsCustomModeFunction( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsSpaceTypeFunctions( + deviceName: name, + deviceId: uuid, + type: 'BOTH', + ), + CpsPresenceStatusFunctions( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + CpsSportsParaFunction( + deviceName: name, + deviceId: uuid, + type: 'IF', + ), + ]; + } }