/// 机型匹配：设计容量 + 机型名称
class DeviceMatching {
  /// 根据机型返回设计容量（mAh）
  static int getDesignCapacity(String model) {
    if (model.contains('22')) return 5510;
    if (model.contains('21 Pro')) return 5050;
    if (model.contains('21')) return 4800;
    if (model.contains('20 Pro')) return 5000;
    if (model.contains('20 INFINITY')) return 4800;
    if (model.contains('20')) return 4700;
    if (model.contains('18s Pro')) return 4500;
    if (model.contains('18s')) return 4000;
    if (model.contains('18X')) return 4300;
    if (model.contains('18 Pro')) return 4500;
    if (model.contains('18')) return 4000;
    if (model.contains('17 Pro')) return 4500;
    if (model.contains('17')) return 4500;
    if (model.contains('16s Pro')) return 3600;
    if (model.contains('16s')) return 3600;
    if (model.contains('16T')) return 4500;
    if (model.contains('16X')) return 3100;
    if (model.contains('16Xs')) return 3900;
    if (model.contains('16th Plus')) return 3640;
    if (model.contains('16th')) return 3010;
    if (model.contains('15 Plus')) return 3430;
    if (model.contains('15')) return 3000;
    return 5050; // 默认 21 Pro
  }

  /// 根据机型返回显示名称
  static String getModelName(String model) {
    if (model.contains('22')) return '魅族22';
    if (model.contains('21 Pro')) return '魅族21 Pro';
    if (model.contains('21')) return '魅族21';
    if (model.contains('20 Pro')) return '魅族20 Pro';
    if (model.contains('20 INFINITY')) return '魅族20 INFINITY';
    if (model.contains('20')) return '魅族20';
    if (model.contains('18s Pro')) return '魅族18s Pro';
    if (model.contains('18s')) return '魅族18s';
    if (model.contains('18X')) return '魅族18X';
    if (model.contains('18 Pro')) return '魅族18 Pro';
    if (model.contains('18')) return '魅族18';
    if (model.contains('17 Pro')) return '魅族17 Pro';
    if (model.contains('17')) return '魅族17';
    if (model.contains('16s Pro')) return '魅族16s Pro';
    if (model.contains('16s')) return '魅族16s';
    if (model.contains('16T')) return '魅族16T';
    if (model.contains('16X')) return '魅族16X';
    if (model.contains('16Xs')) return '魅族16Xs';
    if (model.contains('16th Plus')) return '魅族16th Plus';
    if (model.contains('16th')) return '魅族16th';
    if (model.contains('15 Plus')) return '魅族15 Plus';
    if (model.contains('15')) return '魅族15';
    return '魅族21 Pro (默认)';
  }
}
