Skip to content

Commit d9eccd7

Browse files
committed
Battery (Windows): removes option useSetupApi
1 parent 025febc commit d9eccd7

3 files changed

Lines changed: 0 additions & 24 deletions

File tree

doc/json_schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,11 +1540,6 @@
15401540
"const": "battery",
15411541
"description": "Print battery information"
15421542
},
1543-
"useSetupApi": {
1544-
"description": "Whether to use the `CM API` on Windows to detect battery information. Supports multiple batteries, but is slower (Windows only)",
1545-
"type": "boolean",
1546-
"default": false
1547-
},
15481543
"temp": {
15491544
"$ref": "#/$defs/temperature"
15501545
},

src/modules/battery/battery.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,6 @@ void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module) {
202202
continue;
203203
}
204204

205-
#ifdef _WIN32
206-
if (unsafe_yyjson_equals_str(key, "useSetupApi")) {
207-
options->useSetupApi = yyjson_get_bool(val);
208-
continue;
209-
}
210-
#endif
211-
212205
if (ffTempsParseJsonObject(key, val, &options->temp, &options->tempConfig)) {
213206
continue;
214207
}
@@ -224,10 +217,6 @@ void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module) {
224217
void ffGenerateBatteryJsonConfig(FFBatteryOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) {
225218
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
226219

227-
#ifdef _WIN32
228-
yyjson_mut_obj_add_bool(doc, module, "useSetupApi", options->useSetupApi);
229-
#endif
230-
231220
ffTempsGenerateJsonConfig(doc, module, options->temp, options->tempConfig);
232221
ffPercentGenerateJsonConfig(doc, module, options->percent);
233222
}
@@ -302,10 +291,6 @@ void ffInitBatteryOptions(FFBatteryOptions* options) {
302291
options->temp = false;
303292
options->tempConfig = (FFColorRangeConfig) { 60, 80 };
304293
options->percent = (FFPercentageModuleConfig) { 50, 20, 0 };
305-
306-
#ifdef _WIN32
307-
options->useSetupApi = false;
308-
#endif
309294
}
310295

311296
void ffDestroyBatteryOptions(FFBatteryOptions* options) {

src/modules/battery/option.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ typedef struct FFBatteryOptions {
99
bool temp;
1010
FFColorRangeConfig tempConfig;
1111
FFPercentageModuleConfig percent;
12-
13-
#ifdef _WIN32
14-
bool useSetupApi;
15-
#endif
1612
} FFBatteryOptions;
1713

1814
static_assert(sizeof(FFBatteryOptions) <= FF_OPTION_MAX_SIZE, "FFBatteryOptions size exceeds maximum allowed size");

0 commit comments

Comments
 (0)