import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
import 'package:syncrow_app/generated/assets.dart';

class FlushFunctionsHelper {
  static List<SceneStaticFunction> flushSceneHelperFunctions(
      String deviceId, String deviceName, functionValue) {
    return [
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsPresenceState,
        operationName: 'Presence State',
        code: 'presence_state',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.listOfOptions,
        operationalValues: [
          SceneOperationalValue(
              icon: Assets.nobodyTime, description: "None", value: 'none'),
          SceneOperationalValue(
            icon: Assets.nobodyTime,
            description: "Presence",
            value: 'presence',
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.IlluminanceIcon,
        operationName: 'Illuminance Value',
        code: 'illum_value',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            value: 0.0,
            description: "",
            minValue: 0.0,
            maxValue: 2000.0,
            stepValue: 1.0,
          ),
        ],
      ),
    ];
  }

  static List<SceneStaticFunction> flushAutomationFunctions(
      String deviceId, String deviceName, functionValue) {
    return [
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsSensitivityFunction,
        operationName: 'Sensitivity',
        code: 'sensitivity',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.listOfOptions,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 1,
            description: 1.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 2,
            description: 2.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 3,
            description: 3.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 4,
            description: 4.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 5,
            description: 5.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 6,
            description: 6.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 7,
            description: 7.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 8,
            description: 8.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 9,
            description: 9.toString(),
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.currentDistanceIcon,
        operationName: 'Min Detection Distance',
        code: 'near_detection',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            value: 0.0,
            description: "m",
            minValue: 0.0,
            maxValue: 9.5,
            stepValue: 0.10,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.currentDistanceIcon,
        operationName: 'Max Detection Distance',
        code: 'far_detection',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            value: 0.0,
            description: "m",
            minValue: 0.0,
            maxValue: 9.5,
            stepValue: 0.10,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.levelIcon,
        operationName: 'Trigger Level',
        code: 'sensi_reduce',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.listOfOptions,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 1,
            description: 1.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 2,
            description: 2.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 3,
            description: 3.toString(),
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.indentLevelIcon,
        operationName: 'Indent Level',
        code: 'occur_dist_reduce',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.listOfOptions,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 1,
            description: 1.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 2,
            description: 2.toString(),
          ),
          SceneOperationalValue(
            icon: Assets.assetsSensitivityOperationIcon,
            value: 3,
            description: 3.toString(),
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.targetConfirmTimeIcon,
        operationName: 'Target Confirm Time',
        code: 'presence_delay',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            value: 0.0,
            description: "",
            minValue: 0.0,
            maxValue: 0.5,
            stepValue: 0.1,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'NCPS',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.delayIcon,
        operationName: 'Disappear Delay',
        code: 'none_delay',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            value: 20.0,
            description: "",
            minValue: 20.0,
            maxValue: 300.0,
            stepValue: 1.0,
          ),
        ],
      ),
    ];
  }
}
