Skip to content

Commit

Permalink
fixup! feat(connect): introduce internal_model UNKNOWN
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Dec 6, 2024
1 parent 16d6e2f commit d964041
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/connect/src/core/AbstractMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const DEFAULT_FIRMWARE_RANGE: FirmwareRange = {
T3B1: { min: '2.8.1', max: '0' },
T3T1: { min: '2.7.1', max: '0' },
T3W1: { min: '2.7.1', max: '0' }, // TODO T3W1
UNKNOWN: { min: '0', max: '0' },
UNKNOWN: { min: '1.0.0', max: '0' },
};

function validateStaticSessionId(input: unknown): StaticSessionId {
Expand Down
5 changes: 4 additions & 1 deletion packages/connect/src/device/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,14 +958,17 @@ export class Device extends TypedEmitter<DeviceEvents> {
const revision = parseRevision(feat);
feat.revision = revision;

// feat.model = 'maow';
// feat.internal_model = 'brambora';

// Fix missing model and internal_model in older fw, model has to be fixed first
// 1. - old T1B1 is missing features.model
if (!feat.model && feat.major_version === 1) {
feat.model = '1';
}
// 2. - old fw does not include internal_model. T1B1 does not report it yet, T2T1 starts in 2.6.0
// - or reported internal_model is not known to connect
if (!feat.internal_model) {
if (!feat.internal_model || !DeviceModelInternal[feat.internal_model]) {
feat.internal_model = ensureInternalModelFeature(feat.model);
}

Expand Down

0 comments on commit d964041

Please sign in to comment.