Skip to content

Commit

Permalink
Add TLP 28XX printers to detection list (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cellivar authored Jun 15, 2023
1 parent bfd0c43 commit c7da97c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webzlp",
"version": "1.0.1",
"version": "1.0.2",
"description": "Zebra LP-series WebUSB driver",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
Expand Down
12 changes: 12 additions & 0 deletions src/Printers/Models/EplPrinterModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,15 @@ export class LP2824 extends LP28XX {
return PrinterModel.lp2824;
}
}

export class TLP2824 extends LP28XX {
get model() {
return PrinterModel.tlp2824;
}
}

export class TLP2844 extends LP28XX {
get model() {
return PrinterModel.tlp2844;
}
}
15 changes: 15 additions & 0 deletions src/Printers/Models/PrinterModelDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export class PrinterModelDb {
// TODO: Make this extensible so it's possible for consumers to add their own
// printers to the enum, match list, etc.
switch (rawModelId) {
case 'UKQ1915 U':
// TODO: This is an educated guess, validate it!
return PrinterModel.tlp2824;
case 'UKQ1935 U':
return PrinterModel.tlp2844;

case 'UKQ1915HLU':
return PrinterModel.lp2824;
case 'UKQ1935HLU':
Expand All @@ -31,6 +37,7 @@ export class PrinterModelDb {
// HMU units that do not have FDX in the version string appear to be UPS
// units. Maybe. Mostly. It's not clear.
return PrinterModel.lp2844ups;

case 'LP2824-Z-200dpi':
return PrinterModel.lp2824z;
case 'LP2844-Z-200dpi':
Expand All @@ -45,12 +52,20 @@ export class PrinterModelDb {
// TODO: Make this extensible so it's possible for consumers to add their own
// printers to the enum, match list, etc.
switch (model) {
// LP models, direct thermal only.
case PrinterModel.lp2824:
return new EPL.LP2824();
case PrinterModel.lp2844:
case PrinterModel.lp2844fedex:
case PrinterModel.lp2844ups:
return new EPL.LP2844();

// TLP models, direct thermal or thermal transfer.
case PrinterModel.tlp2824:
return new EPL.TLP2824();
case PrinterModel.tlp2844:
return new EPL.TLP2844();

default:
return new UnknownPrinter();
}
Expand Down

0 comments on commit c7da97c

Please sign in to comment.