Skip to content
Draft
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
5 changes: 4 additions & 1 deletion src/features/devices/cards/AdvancedCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ export function DpiLightingCard({ snapshot }: { snapshot: ControlSnapshot }): Re
const speedMax = hint?.speed.at(-1) ?? profile!.dpiLighting.speed.max;
const locale = snapshot.preferences.locale;
const lightMode = status.dpiLedMode ?? 0;
// Some mice only take a brightness in certain modes (ATK R1: steady only).
const brightnessModes: readonly number[] | undefined = hint?.brightnessModes;
const brightnessLocked = lightMode === 0 || (brightnessModes != null && !brightnessModes.includes(lightMode));

const staged = snapshot.pending.keys.some((key) => key.startsWith("teevolution-dpi-light-") || key === "dpi-light-sleep");
return (
Expand Down Expand Up @@ -684,7 +687,7 @@ export function DpiLightingCard({ snapshot }: { snapshot: ControlSnapshot }): Re
max={brightnessMax}
step={1}
value={status.dpiLedBrightness ?? brightnessMin}
disabled={lightMode === 0 || status.dpiLedBrightness == null}
disabled={brightnessLocked || status.dpiLedBrightness == null}
style={{
"--fill": `${((status.dpiLedBrightness ?? brightnessMin) - brightnessMin)
/ Math.max(1, brightnessMax - brightnessMin) * 100}%`,
Expand Down
Loading