import 'package:farm_tpf/custom_model/Device.dart';
import 'package:get/get.dart';

class ChangeDevice extends GetxController {
  Device currentDevice = Device();
  int selectedDeviceId = -1;
  String selectedDeviceName = '';

  void initValue() {
    currentDevice = Device();
    selectedDeviceName = "";
    selectedDeviceId = -1;
    update();
  }

  void change(Device device) {
    currentDevice = device;
    selectedDeviceId = device.id ?? -1;
    selectedDeviceName = device.name ?? '';
    update();
  }

  void changeByIdAndName(int id, String name) {
    selectedDeviceId = id;
    selectedDeviceName = name;
    update();
  }
}
