class Device {
  int? id;
  String? name;
  String? status;
  String? location;
  num? mode;
  bool? isSelected;

  Device({this.id, this.name, this.status, this.location, this.mode});

  Device.clone(Device device) {
    id = device.id;
    name = device.name;
    status = device.status;
    location = device.location;
    mode = device.mode;
  }

  Device.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    status = json['status'];
    location = json['location'];
    mode = json['mode'];
    isSelected = false;
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['status'] = status;
    data['location'] = location;
    data['mode'] = mode;
    return data;
  }
}
