Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/drivers/pulsar/pulsar-xs1-hid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ test("reads the X3 status from the feature interface", async () => {
const status = await client.readStatus();

assert.equal(status.brand, "Pulsar");
assert.equal(status.name, "Pulsar X3 Medium 1K Dongle");
assert.equal(status.name, "Pulsar X3 M");
assert.equal(status.connectionType, "Wireless");
assert.equal(status.connectionDetail, "XS-1 feature-report interface");
assert.equal(status.dpi, 1600);
Expand Down
8 changes: 7 additions & 1 deletion src/drivers/pulsar/pulsar-xs1-hid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const RESPONSE_ATTEMPTS = 5;
const RESPONSE_DELAY_MS = 25;
const DPI_VALUE_OFFSET = 7;

// The X3 family dongles report a generic "1K Dongle" product name from WebHID,
// which is useless in the UI. Known product ids map to the paired model name.
const XS1_PRODUCT_NAMES: ReadonlyMap<number, string> = new Map([
[0x5402, "Pulsar X3 M"],
]);

const LIFT_OFF_DISTANCES: ReadonlyArray<readonly [number, LiftOffDistance]> = [
[0x07, "Low"],
[0x0a, "Medium"],
Expand Down Expand Up @@ -124,7 +130,7 @@ export class PulsarXs1HidClient {
const pollingRate = await this.query(QUERY.pollingRate).catch(() => null);
return this.lastStatus = {
brand: "Pulsar",
name: this.device.productName || "Pulsar X3",
name: XS1_PRODUCT_NAMES.get(this.device.productId) ?? (this.device.productName || "Pulsar X3"),
ui: {
family: "pulsar",
hideUnsupportedPollingRates: true,
Expand Down