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 WaterHeaterFunctionsHelper {
  static List<SceneStaticFunction> waterHeaterHelperFunctions(
      String deviceId, String deviceName, functionValue) {
    return [
      SceneStaticFunction(
        deviceType: 'WH',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsAcPower,
        operationName: 'Switch',
        code: 'switch_1',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.onOff,
        operationalValues: [
          SceneOperationalValue(
              icon: Assets.assetsAcPowerOFF,
              description: "Power OFF",
              value: false),
          SceneOperationalValue(
            icon: Assets.assetsAcPower,
            description: "Power ON",
            value: true,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'WH',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsLightCountdown,
        operationName: 'Timer',
        code: 'countdown_1',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.countdown,
        operationalValues: [
          SceneOperationalValue(icon: '', value: 0),
        ],
      ),
    ];
  }

  static List<SceneStaticFunction> waterHeaterAutomationFunctions(
      String deviceId, String deviceName, functionValue) {
    return [
      SceneStaticFunction(
        deviceType: 'WH',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.refreshStatusIcon,
        operationName: 'Restart Status',
        code: 'relay_status',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.none,
        operationalValues: [
          SceneOperationalValue(
            icon: Assets.assetsAcPowerOFF,
            description: "Power OFF",
            value: 'off',
          ),
          SceneOperationalValue(
            icon: Assets.assetsAcPower,
            description: "Power ON",
            value: 'on',
          ),
          SceneOperationalValue(
            icon: Assets.refreshStatusIcon,
            description: "Restart  Memory",
            value: 'memory',
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'WH',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsAcPower,
        operationName: 'Switch',
        code: 'switch_1',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.onOff,
        operationalValues: [
          SceneOperationalValue(
              icon: Assets.assetsAcPower, description: "ON", value: true),
          SceneOperationalValue(
              icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'WH',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsLightCountdown,
        operationName: 'CountDown',
        code: 'countdown_1',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.integerSteps,
        operationalValues: [
          SceneOperationalValue(
            icon: '',
            description: "sec",
            value: 0.0,
            minValue: 0,
            maxValue: 43200,
            stepValue: 1,
          ),
        ],
      ),
      SceneStaticFunction(
        deviceType: 'WH',
        deviceId: deviceId,
        deviceName: deviceName,
        icon: Assets.assetsIndicator,
        operationName: 'Backlight Switch',
        code: 'switch_backlight',
        functionValue: functionValue,
        operationDialogType: OperationDialogType.onOff,
        operationalValues: [
          SceneOperationalValue(
              icon: Assets.assetsAcPower, description: "ON", value: true),
          SceneOperationalValue(
              icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
        ],
      ),
    ];
  }
}
