From c8f7c40cb749a4ab72d594dfb1f26ba0f407b94e Mon Sep 17 00:00:00 2001 From: Mathias Malmqvist Date: Tue, 28 Oct 2025 01:41:36 +0100 Subject: [PATCH] Show not-genuin-sony-controller message also for DS5 when calibration can't be started --- js/controller-manager.js | 6 ++++-- js/controllers/ds4-controller.js | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/controller-manager.js b/js/controller-manager.js index cf6447c..d4da53e 100644 --- a/js/controller-manager.js +++ b/js/controller-manager.js @@ -3,6 +3,8 @@ import { sleep, la } from './utils.js'; import { l } from './translations.js' +const NOT_GENUINE_SONY_CONTROLLER_MSG = "Your device might not be a genuine Sony controller. If it is not a clone then please report this issue."; + /** * Controller Manager - Manages the current controller instance and provides unified interface */ @@ -211,7 +213,7 @@ class ControllerManager { async calibrateSticksBegin() { const res = await this.currentController.calibrateSticksBegin(); if (!res.ok) { - throw new Error(`${l("Stick calibration failed")}. ${res.error?.message}`, { cause: res.error }); + throw new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG), { cause: res.error }); } } @@ -245,7 +247,7 @@ class ControllerManager { async calibrateRangeBegin() { const res = await this.currentController.calibrateRangeBegin(); if (!res.ok) { - throw new Error(`${l("Stick calibration failed")}. ${res.error?.message}`, { cause: res.error }); + throw new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG), { cause: res.error }); } } diff --git a/js/controllers/ds4-controller.js b/js/controllers/ds4-controller.js index c8b0e6c..d6c4791 100644 --- a/js/controllers/ds4-controller.js +++ b/js/controllers/ds4-controller.js @@ -11,8 +11,6 @@ import { } from '../utils.js'; import { l } from '../translations.js'; -const NOT_GENUINE_SONY_CONTROLLER_MSG = "Your device might not be a genuine Sony controller. If it is not a clone then please report this issue."; - // DS4 Button mapping configuration const DS4_BUTTON_MAP = [ { name: 'up', byte: 4, mask: 0x0 }, // Dpad handled separately @@ -256,7 +254,7 @@ class DS4Controller extends BaseController { la("ds4_calibrate_range_begin_failed", {"d1": d1, "d2": d2}); return { ok: false, - error: new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG)), + error: new Error(`Stick range calibration begin failed: ${d1}, ${d2}`), code: 1, d1, d2 }; } @@ -304,7 +302,7 @@ class DS4Controller extends BaseController { la("ds4_calibrate_sticks_begin_failed", {"d1": d1, "d2": d2}); return { ok: false, - error: new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG)), + error: new Error(`Stick center calibration begin failed: ${d1}, ${d2}`), code: 1, d1, d2, }; }