import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';

abstract class WaterHeaterEvent extends Equatable {
  const WaterHeaterEvent();

  @override
  List<Object> get props => [];
}

class WaterHeaterLoading extends WaterHeaterEvent {}

class WaterHeaterSwitch extends WaterHeaterEvent {
  final bool whSwitch;
  final String deviceId;
  final String productId;
  const WaterHeaterSwitch({required this.whSwitch, this.deviceId = '', this.productId = ''});

  @override
  List<Object> get props => [whSwitch, deviceId, productId];
}

class WaterHeaterUpdated extends WaterHeaterEvent {}

class WaterHeaterInitial extends WaterHeaterEvent {
  const WaterHeaterInitial();
}

class WaterHeaterChangeStatus extends WaterHeaterEvent {}

class GetCounterEvent extends WaterHeaterEvent {
  final String deviceCode;
  const GetCounterEvent({required this.deviceCode});
  @override
  List<Object> get props => [deviceCode];
}

class SetCounterValue extends WaterHeaterEvent {
  final Duration duration;
  final String deviceCode;
  const SetCounterValue({required this.duration, required this.deviceCode});
  @override
  List<Object> get props => [duration, deviceCode];
}

class StartTimer extends WaterHeaterEvent {
  final int duration;

  const StartTimer(this.duration);

  @override
  List<Object> get props => [duration];
}

class TickTimer extends WaterHeaterEvent {
  final int remainingTime;

  const TickTimer(this.remainingTime);

  @override
  List<Object> get props => [remainingTime];
}

class StopTimer extends WaterHeaterEvent {}

class OnClose extends WaterHeaterEvent {}

//------------------- Schedule ----------=---------
class GetScheduleEvent extends WaterHeaterEvent {}

class ScheduleSave extends WaterHeaterEvent {}

class ToggleScheduleEvent extends WaterHeaterEvent {
  final String id;
  final bool toggle;
  const ToggleScheduleEvent({required this.toggle, required this.id});
  @override
  List<Object> get props => [toggle, id];
}

class ToggleDaySelectionEvent extends WaterHeaterEvent {
  final String key;

  const ToggleDaySelectionEvent({required this.key});
  @override
  List<Object> get props => [key];
}

class DeleteScheduleEvent extends WaterHeaterEvent {
  final String id;
  const DeleteScheduleEvent({required this.id});
  @override
  List<Object> get props => [id];
}

class SelectTimeEvent extends WaterHeaterEvent {
  final BuildContext context;
  final bool isEffective;
  const SelectTimeEvent({required this.context, required this.isEffective});
  @override
  List<Object> get props => [context, isEffective];
}

class ToggleSelectedEvent extends WaterHeaterEvent {
  final int index;
  const ToggleSelectedEvent({required this.index});
  @override
  List<Object> get props => [index];
}

class ToggleCreateScheduleEvent extends WaterHeaterEvent {
  final int index;
  const ToggleCreateScheduleEvent({required this.index});
  @override
  List<Object> get props => [index];
}

class ToggleCreateCirculateEvent extends WaterHeaterEvent {
  final int index;
  const ToggleCreateCirculateEvent({required this.index});
  @override
  List<Object> get props => [index];
}

class InitialWizardEvent extends WaterHeaterEvent {}

class ChangeFirstWizardSwitchStatusEvent extends WaterHeaterEvent {
  final bool value;
  final String deviceId;
  const ChangeFirstWizardSwitchStatusEvent({required this.value, this.deviceId = ''});
  @override
  List<Object> get props => [value, deviceId];
}

class GroupAllOnEvent extends WaterHeaterEvent {}

class GroupAllOffEvent extends WaterHeaterEvent {}

class ToggleCreateCirculate extends WaterHeaterEvent {}
