import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';

class SmartPowerEvent extends Equatable {
  @override
  List<Object?> get props => [];
}

class SmartPowerFetchDeviceEvent extends SmartPowerEvent {
  final String deviceId;

  SmartPowerFetchDeviceEvent(this.deviceId);

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

class SmartPowerControl extends SmartPowerEvent {
  final String deviceId;
  final String code;
  final bool value;

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

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

class SmartPowerFetchBatchEvent extends SmartPowerEvent {
  final List<String> devicesIds;

  SmartPowerFetchBatchEvent(this.devicesIds);

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

class SmartPowerBatchControl extends SmartPowerEvent {
  final List<String> devicesIds;
  final String code;
  final bool value;

  SmartPowerBatchControl(
      {required this.devicesIds, required this.code, required this.value});

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

class SmartPowerFactoryReset extends SmartPowerEvent {
  final String deviceId;
  final FactoryResetModel factoryReset;

  SmartPowerFactoryReset({required this.deviceId, required this.factoryReset});

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

class PageChangedEvent extends SmartPowerEvent {
  final int newPage;
  PageChangedEvent(this.newPage);
}

class PageArrowPressedEvent extends SmartPowerEvent {
  final int direction;
  PageArrowPressedEvent(this.direction);
}

class SmartPowerArrowPressedEvent extends SmartPowerEvent {
  final int direction;
  SmartPowerArrowPressedEvent(this.direction);
}

class SmartPowerPageChangedEvent extends SmartPowerEvent {
  final int page;
  SmartPowerPageChangedEvent(this.page);
}

class SelectDateEvent extends SmartPowerEvent {
  BuildContext context;
  SelectDateEvent({required this.context});
}

class FilterRecordsByDateEvent extends SmartPowerEvent {
  final DateTime selectedDate;
  final String viewType; // 'Day', 'Month', 'Year'

  FilterRecordsByDateEvent(
      {required this.selectedDate, required this.viewType});
}

class FetchPowerClampBatchStatusEvent extends SmartPowerEvent {
  final List<String> deviceIds;

   FetchPowerClampBatchStatusEvent(this.deviceIds);

  @override
  List<Object> get props => [deviceIds];
}class PowerBatchControlEvent extends SmartPowerEvent {
  final List<String> deviceIds;
  final String code;
  final dynamic value;

   PowerBatchControlEvent({
    required this.deviceIds,
    required this.code,
    required this.value,
  });

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