fromId method

DeviceModel fromId(
  1. int id
)

Implementation

DeviceModel fromId(int id) {
  for (var model in DeviceModel.values) {
    if (model.index + 1 == id) {
      return model;
    }
  }
  return DeviceModel.unknown;
}