@onekeyfe/hd-core 0.3.35 → 0.3.37-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,18 +73,22 @@ export type Features = PROTO.Features;
73
73
 
74
74
  export type IDeviceType = 'classic' | 'classic1s' | 'mini' | 'touch' | 'pro';
75
75
 
76
- // model_mini: 'classic' | 'mini'
77
- // model_touch: 'touch' | 'pro'
78
- export type IDeviceModel = 'model_mini' | 'model_touch';
76
+ /**
77
+ * model_classic: 'classic' | 'classic1s'
78
+ * model_mini: 'classic' | 'mini'
79
+ * model_touch: 'touch' | 'pro'
80
+ */
81
+ export type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch';
79
82
 
80
83
  export const DeviceModelToTypes: { [deviceModel in IDeviceModel]: IDeviceType[] } = {
81
84
  model_mini: ['classic', 'classic1s', 'mini'],
82
85
  model_touch: ['touch', 'pro'],
86
+ model_classic: ['classic', 'classic1s'],
83
87
  };
84
88
 
85
89
  export const DeviceTypeToModels: { [deviceType in IDeviceType]: IDeviceModel[] } = {
86
- classic: ['model_mini'],
87
- classic1s: ['model_mini'],
90
+ classic: ['model_classic', 'model_mini'],
91
+ classic1s: ['model_classic', 'model_mini'],
88
92
  mini: ['model_mini'],
89
93
  touch: ['model_touch'],
90
94
  pro: ['model_touch'],
@@ -9,7 +9,7 @@ import type {
9
9
  IVersionArray,
10
10
  SupportFeatureType,
11
11
  } from '../types';
12
- import { DeviceTypeToModels } from '../types';
12
+ import { DeviceModelToTypes, DeviceTypeToModels } from '../types';
13
13
  import DataManager, { FirmwareField, MessageVersion } from '../data-manager/DataManager';
14
14
  import { PROTOBUF_MESSAGE_CONFIG } from '../data-manager/MessagesConfig';
15
15
  import { Device } from '../device/Device';
@@ -68,6 +68,7 @@ export const getDeviceTypeByBleName = (name?: string): IDeviceType | null => {
68
68
  return 'classic';
69
69
  };
70
70
 
71
+ // @deprecated
71
72
  export const getDeviceTypeByDeviceId = (deviceId?: string): IDeviceType => {
72
73
  if (!deviceId) {
73
74
  return 'classic';
@@ -253,7 +254,7 @@ export const supportModifyHomescreen = (features?: Features): SupportFeatureType
253
254
  const currentVersion = getDeviceFirmwareVersion(features).join('.');
254
255
 
255
256
  const deviceType = getDeviceType(features);
256
- if (deviceType === 'classic' || deviceType === 'mini') {
257
+ if (DeviceModelToTypes.model_mini.includes(deviceType)) {
257
258
  return { support: true };
258
259
  }
259
260
 
@@ -278,7 +279,7 @@ export const getFirmwareUpdateField = ({
278
279
  return 'ble';
279
280
  }
280
281
 
281
- if (deviceType === 'classic' || deviceType === 'mini') {
282
+ if (DeviceModelToTypes.model_mini.includes(deviceType)) {
282
283
  return 'firmware-v4';
283
284
  }
284
285