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 DoorLockHelperFunctions {
  /// tab to run functions
  static List<SceneStaticFunction> doorLockTapToRunFunctions(
      String deviceId, String deviceName, functionValue) {
    return [
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsIconsDoorLock,
        operationName: 'Set Door lock Normal Open',
        functionValue: functionValue,
        code: 'normal_open_switch',
        operationDialogType: OperationDialogType.onOff,
        operationalValues: [
          SceneOperationalValue(
              icon: Assets.assetsAcPower, description: "ON", value: true),
          SceneOperationalValue(
              icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
        ],
      ),
    ];
  }

  //// automation functions
  static List<SceneStaticFunction> doorLockAutomationFunctions(
      String deviceId, String deviceName, functionValue) {
    return [
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsFingerprintUnlock,
        operationName: 'Fingerprint Unlock',
        functionValue: functionValue,
        code: 'unlock_fingerprint',
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0.0,
            maxValue: 999,
            stepValue: 1.0,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsPasswordUnlock,
        operationName: 'Password Unlock',
        functionValue: functionValue,
        code: 'unlock_password',
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0.0,
            maxValue: 999,
            stepValue: 1.0,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsCardUnlock,
        operationName: 'Card Unlock',
        functionValue: functionValue,
        code: 'unlock_card',
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0.0,
            maxValue: 999,
            stepValue: 1.0,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsLockAlarm,
        operationName: 'Lock Alarm',
        functionValue: functionValue,
        code: 'alarm_lock',
        operationDialogType: OperationDialogType.listOfOptions,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsFingerprintUnlock,
            description: "Fingerprint Mismatch",
            value: 'wrong_finger',
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsRemoteUnlockReq,
        operationName: 'Remote Unlock Request',
        functionValue: functionValue,
        code: 'unlock_request',
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0,
            maxValue: 90,
            stepValue: 1,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsResidualElectricity,
        operationName: 'Residual Electricity',
        functionValue: functionValue,
        code: 'residual_electricity',
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0,
            maxValue: 100,
            stepValue: 1,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsDoubleLock,
        operationName: 'Double Lock',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.onOff,
        code: 'reverse_lock',
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsAcPower,
            description: "ON",
            value: true,
          ),
          SceneOperationalValue(
            icon: Assets.assetsAcPowerOFF,
            description: "OFF",
            value: false,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsRemoteUnlockViaApp,
        operationName: 'Remote Unlock Via App',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        code: 'unlock_app',
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0,
            maxValue: 999,
            stepValue: 1,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsHijackAlarm,
        operationName: 'Hijack Alarm',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.onOff,
        code: 'hijack',
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsAcPower,
            description: "ON",
            value: true,
          ),
          SceneOperationalValue(
            icon: Assets.assetsAcPowerOFF,
            description: "OFF",
            value: false,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsDoorlockNormalOpen,
        operationName: 'Set Door Lock Normal Open',
        functionValue: functionValue,
        code: 'normal_open_switch',
        operationDialogType: OperationDialogType.onOff,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsAcPower,
            description: "ON",
            value: true,
          ),
          SceneOperationalValue(
            icon: Assets.assetsAcPowerOFF,
            description: "OFF",
            value: false,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsDoorlockNormalOpen,
        operationName: 'Doorbell',
        functionValue: functionValue,
        code: 'doorbell',
        operationDialogType: OperationDialogType.onOff,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsAcPower,
            description: "ON",
            value: true,
          ),
          SceneOperationalValue(
            icon: Assets.assetsAcPowerOFF,
            description: "OFF",
            value: false,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'DL',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsTempPasswordUnlock,
        operationName: 'Temporary Password Unlock',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        code: 'unlock_temporary',
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "",
            value: 0.0,
            minValue: 0,
            maxValue: 999,
            stepValue: 1,
          ),
        ],
      ),
    ];
  }
}
