Add Polling rate setting

This commit is contained in:
redphx
2024-10-21 22:01:32 +07:00
parent 831fd98d02
commit 5e98c756d4
10 changed files with 56 additions and 11 deletions

View File

@@ -388,6 +388,29 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
},
},
[PrefKey.CONTROLLER_POLLING_RATE]: {
requiredVariants: 'full',
label: t('polling-rate'),
type: SettingElementType.NUMBER_STEPPER,
default: 4,
min: 4,
max: 40,
steps: 4,
params: {
reverse: true,
customTextValue(value: any) {
value = parseInt(value);
let text = +(1000 / value).toFixed(2) + ' Hz';
if (value === 4) {
text = `${t('default')} (${text})`;
}
return text;
},
},
},
[PrefKey.MKB_ENABLED]: {
requiredVariants: 'full',
label: t('enable-mkb'),