import 'package:equatable/equatable.dart';
import 'package:syncrow_app/features/devices/model/garage_door_model.dart';
import 'package:syncrow_app/features/devices/model/group_garage_model.dart';

class GarageDoorSensorState extends Equatable {
  const GarageDoorSensorState();

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

class GarageDoorInitialState extends GarageDoorSensorState {}

class GarageDoorLoadingState extends GarageDoorSensorState {}

class GarageDoorFailedState extends GarageDoorSensorState {
  final String errorMessage;

  const GarageDoorFailedState({required this.errorMessage});

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

class UpdateState extends GarageDoorSensorState {
  final GarageDoorModel garageSensor;
  const UpdateState({required this.garageSensor});

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

class LoadingNewSate extends GarageDoorSensorState {
  final GarageDoorModel doorSensor;
  const LoadingNewSate({required this.doorSensor});

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

class ChangeSlidingSegmentState extends GarageDoorSensorState {
  final int value;

  const ChangeSlidingSegmentState({required this.value});

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

class UpdateTimerState extends GarageDoorSensorState {
  final int seconds;
  const UpdateTimerState({required this.seconds});

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

class TimerRunInProgress extends GarageDoorSensorState {
  final int remainingTime;

  const TimerRunInProgress(this.remainingTime);

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

class TimerRunComplete extends GarageDoorSensorState {}

class SaveSchedule extends GarageDoorSensorState {}

class IsToggleState extends GarageDoorSensorState {
  final bool? onOff;
  const IsToggleState({this.onOff});
}

class ChangeTimeState extends GarageDoorSensorState {}

class LoadingInitialState extends GarageDoorSensorState {}

class UpdateCreateScheduleState extends GarageDoorSensorState {
  final bool createSchedule;
  UpdateCreateScheduleState(this.createSchedule);
}

class UpdateGroupState extends GarageDoorSensorState {
  final List<GroupGarageModel> garageList;
  final bool allSwitches;

  const UpdateGroupState(
      {required this.garageList, required this.allSwitches});

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