import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
import 'package:syncrow_web/pages/device_managment/door_lock/models/door_lock_status_model.dart';

sealed class DoorLockEvent extends Equatable {
  const DoorLockEvent();

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

class DoorLockFetchStatus extends DoorLockEvent {
  final String deviceId;

  const DoorLockFetchStatus(this.deviceId);

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

class DoorLockControl extends DoorLockEvent {
  final String deviceId;
  final String code;
  final bool value;

  const DoorLockControl({
    required this.deviceId,
    required this.code,
    required this.value,
  });

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

class UpdateLockEvent extends DoorLockEvent {
  final bool value;
  const UpdateLockEvent({required this.value});
  @override
  List<Object> get props => [value];
}

class DoorLockFactoryReset extends DoorLockEvent {
  final String deviceId;
  final FactoryResetModel factoryReset;

  const DoorLockFactoryReset({
    required this.deviceId,
    required this.factoryReset,
  });

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

class StatusUpdated extends DoorLockEvent {
  final DoorLockStatusModel deviceStatus;
  const StatusUpdated(this.deviceStatus);
  @override
  List<Object> get props => [deviceStatus];
}
