From 570d7f6c8818ccf531d5b9bcc1017332b42c4e46 Mon Sep 17 00:00:00 2001 From: Mathias Malmqvist Date: Sun, 12 Oct 2025 16:38:38 +0200 Subject: [PATCH] Removed superfluous analystics calls --- js/controllers/ds4-controller.js | 11 +++++------ js/controllers/ds5-controller.js | 13 ++++++------- js/controllers/ds5-edge-controller.js | 2 +- js/modals/finetune-modal.js | 4 +++- js/modals/quick-test-modal.js | 8 ++++++++ 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/js/controllers/ds4-controller.js b/js/controllers/ds4-controller.js index 7b69d1d..89be4a4 100644 --- a/js/controllers/ds4-controller.js +++ b/js/controllers/ds4-controller.js @@ -7,7 +7,6 @@ import { dec2hex, dec2hex32, format_mac_from_view, - lf, la } from '../utils.js'; import { l } from '../translations.js'; @@ -140,7 +139,7 @@ class DS4Controller extends BaseController { let deviceTypeText = l("unknown"); let is_clone = false; - const view = lf("ds4_info", await this.receiveFeatureReport(0xa3)); + const view = await this.receiveFeatureReport(0xa3); const cmd = view.getUint8(0, true); @@ -218,7 +217,7 @@ class DS4Controller extends BaseController { } async nvsLock() { - la("ds4_nvlock"); + // la("ds4_nvlock"); try { await this.sendFeatureReport(0xa0, [10,1,0]); return { ok: true }; @@ -228,7 +227,7 @@ class DS4Controller extends BaseController { } async nvsUnlock() { - la("ds4_nvunlock"); + // la("ds4_nvunlock"); try { await this.sendFeatureReport(0xa0, [10,2,0x3e,0x71,0x7f,0x89]); return { ok: true }; @@ -238,7 +237,7 @@ class DS4Controller extends BaseController { } async getBdAddr() { - const view = lf("ds4_getbdaddr", await this.receiveFeatureReport(0x12)); + const view = await this.receiveFeatureReport(0x12); return format_mac_from_view(view, 1); } @@ -363,7 +362,7 @@ class DS4Controller extends BaseController { async queryNvStatus() { try { await this.sendFeatureReport(0x08, [0xff,0, 12]); - const data = lf("ds4_nvstatus", await this.receiveFeatureReport(0x11)); + const data = await this.receiveFeatureReport(0x11); const ret = data.getUint8(1, false); const res = { device: 'ds4', code: ret } switch(ret) { diff --git a/js/controllers/ds5-controller.js b/js/controllers/ds5-controller.js index caf7c5e..c500c72 100644 --- a/js/controllers/ds5-controller.js +++ b/js/controllers/ds5-controller.js @@ -10,7 +10,6 @@ import { format_mac_from_view, reverse_str, la, - lf } from '../utils.js'; import { l } from '../translations.js'; @@ -275,7 +274,7 @@ class DS5Controller extends BaseController { // Device-only: collect info and return a common structure; do not touch the DOM try { console.log("Fetching DS5 info..."); - const view = lf("ds5_info", await this.receiveFeatureReport(0x20)); + const view = await this.receiveFeatureReport(0x20); console.log("Got DS5 info report:", buf2hex(view.buffer)); const cmd = view.getUint8(0, true); if(cmd != 0x20 || view.buffer.byteLength != 64) @@ -367,7 +366,7 @@ class DS5Controller extends BaseController { } async nvsLock() { - la("ds5_nvlock"); + // la("ds5_nvlock"); try { await this.sendFeatureReport(0x80, [3,1]); await this.receiveFeatureReport(0x81); @@ -378,7 +377,7 @@ class DS5Controller extends BaseController { } async nvsUnlock() { - la("ds5_nvunlock"); + // la("ds5_nvunlock"); try { await this.sendFeatureReport(0x80, [3,2, 101, 50, 64, 12]); const data = await this.receiveFeatureReport(0x81); @@ -390,13 +389,13 @@ class DS5Controller extends BaseController { async getBdAddr() { await this.sendFeatureReport(0x80, [9,2]); - const data = lf("ds5_getbdaddr", await this.receiveFeatureReport(0x81)); + const data = await this.receiveFeatureReport(0x81); return format_mac_from_view(data, 4); } async getSystemInfo(base, num, length, decode = true) { await this.sendFeatureReport(128, [base,num]) - const pcba_id = lf("ds5_pcba_id", await this.receiveFeatureReport(129)); + const pcba_id = await this.receiveFeatureReport(129); if(pcba_id.getUint8(1) != base || pcba_id.getUint8(2) != num || pcba_id.getUint8(3) != 2) { return l("error"); } @@ -512,7 +511,7 @@ class DS5Controller extends BaseController { async queryNvStatus() { try { await this.sendFeatureReport(0x80, [3,3]); - const data = lf("ds5_nvstatus", await this.receiveFeatureReport(0x81)); + const data = await this.receiveFeatureReport(0x81); const ret = data.getUint32(1, false); if (ret === 0x15010100) { return { device: 'ds5', status: 'pending_reboot', locked: null, code: 4, raw: ret }; diff --git a/js/controllers/ds5-edge-controller.js b/js/controllers/ds5-edge-controller.js index 363d52c..50bc985 100644 --- a/js/controllers/ds5-edge-controller.js +++ b/js/controllers/ds5-edge-controller.js @@ -53,7 +53,7 @@ class DS5EdgeController extends DS5Controller { await this.sendFeatureReport(0x80, [21,34]); await sleep(100); - const data = lf("ds5_edge_get_barcode", await this.receiveFeatureReport(0x81)); + const data = await this.receiveFeatureReport(0x81); const td = new TextDecoder(); const r_bc = td.decode(data.buffer.slice(21, 21+17)); const l_bc = td.decode(data.buffer.slice(40, 40+17)); diff --git a/js/modals/finetune-modal.js b/js/modals/finetune-modal.js index 4f6b153..620bbd8 100644 --- a/js/modals/finetune-modal.js +++ b/js/modals/finetune-modal.js @@ -1,7 +1,7 @@ 'use strict'; import { draw_stick_position } from '../stick-renderer.js'; -import { dec2hex32, float_to_str } from '../utils.js'; +import { dec2hex32, float_to_str, la } from '../utils.js'; import { auto_calibrate_stick_centers } from './calib-center-modal.js'; import { calibrate_range } from './calib-range-modal.js'; @@ -124,6 +124,8 @@ export class Finetune { } async init(controllerInstance, { ll_data, rr_data, clear_circularity }, doneCallback = null) { + la("finetune_modal_open"); + this.controller = controllerInstance; this.ll_data = ll_data; this.rr_data = rr_data; diff --git a/js/modals/quick-test-modal.js b/js/modals/quick-test-modal.js index 477b817..57e5f81 100644 --- a/js/modals/quick-test-modal.js +++ b/js/modals/quick-test-modal.js @@ -1,6 +1,7 @@ 'use strict'; import { l } from '../translations.js'; +import { la } from '../utils.js' const TEST_SEQUENCE = ['usb', 'buttons', 'adaptive', 'haptic', 'lights', 'speaker', 'headphone', 'microphone']; const TEST_NAMES = { @@ -503,6 +504,8 @@ export class QuickTestModal { * Open the Quick Test modal */ async open() { + la("quick_test_modal_open"); + // Build the dynamic accordion first this._buildDynamicAccordion(); await this._initSvgController(); @@ -575,6 +578,11 @@ export class QuickTestModal { this._setSvgGroupColor(group, midBlue); }); + ['qt-Controller_infills', 'qt-Button_infills', 'qt-L3_infill', 'qt-R3_infill', 'qt-Trackpad_infill'].forEach(id => { + const group = document.getElementById(id); + this._setSvgGroupColor(group, 'white'); + }); + this._resetButtonColors(); }