Battery (Windows): removes option useSetupApi

This commit is contained in:
李通洲
2026-04-29 18:54:18 +08:00
parent 025febc78d
commit d9eccd70ed
3 changed files with 0 additions and 24 deletions
-5
View File
@@ -1540,11 +1540,6 @@
"const": "battery",
"description": "Print battery information"
},
"useSetupApi": {
"description": "Whether to use the `CM API` on Windows to detect battery information. Supports multiple batteries, but is slower (Windows only)",
"type": "boolean",
"default": false
},
"temp": {
"$ref": "#/$defs/temperature"
},
-15
View File
@@ -202,13 +202,6 @@ void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module) {
continue;
}
#ifdef _WIN32
if (unsafe_yyjson_equals_str(key, "useSetupApi")) {
options->useSetupApi = yyjson_get_bool(val);
continue;
}
#endif
if (ffTempsParseJsonObject(key, val, &options->temp, &options->tempConfig)) {
continue;
}
@@ -224,10 +217,6 @@ void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module) {
void ffGenerateBatteryJsonConfig(FFBatteryOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) {
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
#ifdef _WIN32
yyjson_mut_obj_add_bool(doc, module, "useSetupApi", options->useSetupApi);
#endif
ffTempsGenerateJsonConfig(doc, module, options->temp, options->tempConfig);
ffPercentGenerateJsonConfig(doc, module, options->percent);
}
@@ -302,10 +291,6 @@ void ffInitBatteryOptions(FFBatteryOptions* options) {
options->temp = false;
options->tempConfig = (FFColorRangeConfig) { 60, 80 };
options->percent = (FFPercentageModuleConfig) { 50, 20, 0 };
#ifdef _WIN32
options->useSetupApi = false;
#endif
}
void ffDestroyBatteryOptions(FFBatteryOptions* options) {
-4
View File
@@ -9,10 +9,6 @@ typedef struct FFBatteryOptions {
bool temp;
FFColorRangeConfig tempConfig;
FFPercentageModuleConfig percent;
#ifdef _WIN32
bool useSetupApi;
#endif
} FFBatteryOptions;
static_assert(sizeof(FFBatteryOptions) <= FF_OPTION_MAX_SIZE, "FFBatteryOptions size exceeds maximum allowed size");