From f5b61536a7ab1d2e2e5e190cd7fd84b47d522812 Mon Sep 17 00:00:00 2001 From: Thinh-Gin <86916177+anhthinhvup@users.noreply.github.com> Date: Mon, 11 May 2026 09:45:07 +0700 Subject: [PATCH] fix: avoid redundant keyboard brightness writes --- src/main/device/razerdevicekeyboard.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/device/razerdevicekeyboard.js b/src/main/device/razerdevicekeyboard.js index 70f1d106..7c775721 100644 --- a/src/main/device/razerdevicekeyboard.js +++ b/src/main/device/razerdevicekeyboard.js @@ -33,7 +33,9 @@ export class RazerDeviceKeyboard extends RazerDevice { resetToState(state) { super.resetToState(state); - this.setBrightness(state.brightness); + if(typeof state.brightness !== 'undefined' && state.brightness !== this.brightness) { + this.setBrightness(state.brightness); + } } destroy() { @@ -130,4 +132,4 @@ export class RazerDeviceKeyboard extends RazerDevice { setModeCustom() { this.addon.kbdSetModeCustom(this.internalId); } -} \ No newline at end of file +}