class DeviceInfo {
  final String deviceName;
  final String deviceId;
  final String location;
  final String status;
  final String voltage;
  final String current;
  final String power;
  final String temperature;
  final List<int> powerData;
  final List<int> tempData;

  const DeviceInfo({
    required this.deviceName,
    required this.deviceId,
    required this.location,
    required this.status,
    required this.voltage,
    required this.current,
    required this.power,
    required this.temperature,
    required this.powerData,
    required this.tempData,
  });
}

class DeviceState {
  final bool isLoading;
  final String? error;
  final DeviceInfo? deviceInfo;
  final bool isPoweringOn;
  final bool isPoweringOff;
  final String? operationMessage;

  const DeviceState({
    this.isLoading = false,
    this.error,
    this.deviceInfo,
    this.isPoweringOn = false,
    this.isPoweringOff = false,
    this.operationMessage,
  });

  DeviceState copyWith({
    bool? isLoading,
    String? error,
    DeviceInfo? deviceInfo,
    bool? isPoweringOn,
    bool? isPoweringOff,
    String? operationMessage,
  }) {
    return DeviceState(
      isLoading: isLoading ?? this.isLoading,
      error: error ?? this.error,
      deviceInfo: deviceInfo ?? this.deviceInfo,
      isPoweringOn: isPoweringOn ?? this.isPoweringOn,
      isPoweringOff: isPoweringOff ?? this.isPoweringOff,
      operationMessage: operationMessage ?? this.operationMessage,
    );
  }
}