import 'package:equatable/equatable.dart';

class ServiceDeviceState extends Equatable {
  final bool isOn;
  final int targetTemperature;
  final int currentTemperature;
  final int minTemperature;
  final int maxTemperature;
  final List<Map<String, dynamic>> modeData;
  final String currentSpeed;
  final List<String> speedOptions;

  const ServiceDeviceState({
    this.isOn = true,
    this.targetTemperature = 24,
    this.currentTemperature = 26,
    this.minTemperature = 16,
    this.maxTemperature = 34,
    this.modeData = const [],
    this.currentSpeed = '自动',
    this.speedOptions = const ['自动', '低', '中', '高'],
  });

  ServiceDeviceState copyWith({
    bool? isOn,
    int? targetTemperature,
    int? currentTemperature,
    int? minTemperature,
    int? maxTemperature,
    List<Map<String, dynamic>>? modeData,
    String? currentSpeed,
    List<String>? speedOptions,
  }) {
    return ServiceDeviceState(
      isOn: isOn ?? this.isOn,
      targetTemperature: targetTemperature ?? this.targetTemperature,
      currentTemperature: currentTemperature ?? this.currentTemperature,
      minTemperature: minTemperature ?? this.minTemperature,
      maxTemperature: maxTemperature ?? this.maxTemperature,
      modeData: modeData ?? this.modeData,
      currentSpeed: currentSpeed ?? this.currentSpeed,
      speedOptions: speedOptions ?? this.speedOptions,
    );
  }

  @override
  List<Object?> get props => [
        isOn,
        targetTemperature,
        currentTemperature,
        minTemperature,
        maxTemperature,
        modeData,
        currentSpeed,
        speedOptions,
      ];
}