From 874942fd36052be4ecbb63b6bee8d366fcc496ce Mon Sep 17 00:00:00 2001 From: zhon12345 <43035773+zhon12345@users.noreply.github.com> Date: Fri, 7 Feb 2025 17:18:26 +0800 Subject: [PATCH 1/3] Display: capitalize {type}'s output --- doc/json_schema.json | 4 +--- src/modules/display/display.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index 05b27b9fe0..8b1fbc6c76 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -108,8 +108,6 @@ } ] }, - - "batteryFormat": { "description": "Output format of the module `Battery`. See `-h format` for formatting syntax\n 1. {manufacturer}: Battery manufacturer\n 2. {model-name}: Battery model name\n 3. {technology}: Battery technology\n 4. {capacity}: Battery capacity (percentage num)\n 5. {status}: Battery status\n 6. {temperature}: Battery temperature (formatted)\n 7. {cycle-count}: Battery cycle count\n 8. {serial}: Battery serial number\n 9. {manufacture-date}: Battery manufactor date\n 10. {capacity-bar}: Battery capacity (percentage bar)\n 11. {time-days}: Battery time remaining days\n 12. {time-hours}: Battery time remaining hours\n 13. {time-minutes}: Battery time remaining minutes\n 14. {time-seconds}: Battery time remaining seconds", "type": "string" @@ -179,7 +177,7 @@ "type": "string" }, "displayFormat": { - "description": "Output format of the module `Display`. See `-h format` for formatting syntax\n 1. {width}: Screen configured width (in pixels)\n 2. {height}: Screen configured height (in pixels)\n 3. {refresh-rate}: Screen configured refresh rate (in Hz)\n 4. {scaled-width}: Screen scaled width (in pixels)\n 5. {scaled-height}: Screen scaled height (in pixels)\n 6. {name}: Screen name\n 7. {type}: Screen type (builtin, external or unknown)\n 8. {rotation}: Screen rotation (in degrees)\n 9. {is-primary}: True if being the primary screen\n 10. {physical-width}: Screen physical width (in millimeters)\n 11. {physical-height}: Screen physical height (in millimeters)\n 12. {inch}: Physical diagonal length in inches\n 13. {ppi}: Pixels per inch (PPI)\n 14. {bit-depth}: Bits per color channel\n 15. {hdr-enabled}: True if high dynamic range (HDR) mode is enabled\n 16. {manufacture-year}: Year of manufacturing\n 17. {manufacture-week}: Nth week of manufacturing in the year\n 18. {serial}: Serial number\n 19. {platform-api}: The platform API used when detecting the display\n 20. {hdr-compatible}: True if the display is HDR compatible\n 21. {scale-factor}: HiDPI scale factor\n 22. {preferred-width}: Screen preferred width (in pixels)\n 23. {preferred-height}: Screen preferred height (in pixels)\n 24. {preferred-refresh-rate}: Screen preferred refresh rate (in Hz)", + "description": "Output format of the module `Display`. See `-h format` for formatting syntax\n 1. {width}: Screen configured width (in pixels)\n 2. {height}: Screen configured height (in pixels)\n 3. {refresh-rate}: Screen configured refresh rate (in Hz)\n 4. {scaled-width}: Screen scaled width (in pixels)\n 5. {scaled-height}: Screen scaled height (in pixels)\n 6. {name}: Screen name\n 7. {type}: Screen type (Built-in, External or unknown)\n 8. {rotation}: Screen rotation (in degrees)\n 9. {is-primary}: True if being the primary screen\n 10. {physical-width}: Screen physical width (in millimeters)\n 11. {physical-height}: Screen physical height (in millimeters)\n 12. {inch}: Physical diagonal length in inches\n 13. {ppi}: Pixels per inch (PPI)\n 14. {bit-depth}: Bits per color channel\n 15. {hdr-enabled}: True if high dynamic range (HDR) mode is enabled\n 16. {manufacture-year}: Year of manufacturing\n 17. {manufacture-week}: Nth week of manufacturing in the year\n 18. {serial}: Serial number\n 19. {platform-api}: The platform API used when detecting the display\n 20. {hdr-compatible}: True if the display is HDR compatible\n 21. {scale-factor}: HiDPI scale factor\n 22. {preferred-width}: Screen preferred width (in pixels)\n 23. {preferred-height}: Screen preferred height (in pixels)\n 24. {preferred-refresh-rate}: Screen preferred refresh rate (in Hz)", "type": "string" }, "diskFormat": { diff --git a/src/modules/display/display.c b/src/modules/display/display.c index fdf4276822..ea6fe5441e 100644 --- a/src/modules/display/display.c +++ b/src/modules/display/display.c @@ -75,7 +75,7 @@ void ffPrintDisplay(FFDisplayOptions* options) { FFDisplayResult* result = FF_LIST_GET(FFDisplayResult, dsResult->displays, i); uint32_t moduleIndex = dsResult->displays.length == 1 ? 0 : i + 1; - const char* displayType = result->type == FF_DISPLAY_TYPE_UNKNOWN ? NULL : result->type == FF_DISPLAY_TYPE_BUILTIN ? "built-in" : "external"; + const char* displayType = result->type == FF_DISPLAY_TYPE_UNKNOWN ? NULL : result->type == FF_DISPLAY_TYPE_BUILTIN ? "Built-in" : "External"; ffStrbufClear(&key); if(options->moduleArgs.key.length == 0) @@ -448,7 +448,7 @@ static FFModuleBaseInfo ffModuleInfo = { {"Screen scaled width (in pixels)", "scaled-width"}, {"Screen scaled height (in pixels)", "scaled-height"}, {"Screen name", "name"}, - {"Screen type (builtin, external or unknown)", "type"}, + {"Screen type (Built-in, External or unknown)", "type"}, {"Screen rotation (in degrees)", "rotation"}, {"True if being the primary screen", "is-primary"}, {"Screen physical width (in millimeters)", "physical-width"}, From 7a5cb806c6a70a437c57ce6f60dfbb84c31e2012 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 7 Feb 2025 21:29:55 +0800 Subject: [PATCH 2/3] Update display.c --- src/modules/display/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/display/display.c b/src/modules/display/display.c index ea6fe5441e..604f17615f 100644 --- a/src/modules/display/display.c +++ b/src/modules/display/display.c @@ -448,7 +448,7 @@ static FFModuleBaseInfo ffModuleInfo = { {"Screen scaled width (in pixels)", "scaled-width"}, {"Screen scaled height (in pixels)", "scaled-height"}, {"Screen name", "name"}, - {"Screen type (Built-in, External or unknown)", "type"}, + {"Screen type (Built-in or External)", "type"}, {"Screen rotation (in degrees)", "rotation"}, {"True if being the primary screen", "is-primary"}, {"Screen physical width (in millimeters)", "physical-width"}, From 233fb2c7ba514247570111ea5b7b6de855a66c1c Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 7 Feb 2025 21:30:58 +0800 Subject: [PATCH 3/3] Update json_schema.json --- doc/json_schema.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index 8b1fbc6c76..61308e83c5 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -108,6 +108,8 @@ } ] }, + + "batteryFormat": { "description": "Output format of the module `Battery`. See `-h format` for formatting syntax\n 1. {manufacturer}: Battery manufacturer\n 2. {model-name}: Battery model name\n 3. {technology}: Battery technology\n 4. {capacity}: Battery capacity (percentage num)\n 5. {status}: Battery status\n 6. {temperature}: Battery temperature (formatted)\n 7. {cycle-count}: Battery cycle count\n 8. {serial}: Battery serial number\n 9. {manufacture-date}: Battery manufactor date\n 10. {capacity-bar}: Battery capacity (percentage bar)\n 11. {time-days}: Battery time remaining days\n 12. {time-hours}: Battery time remaining hours\n 13. {time-minutes}: Battery time remaining minutes\n 14. {time-seconds}: Battery time remaining seconds", "type": "string" @@ -177,7 +179,7 @@ "type": "string" }, "displayFormat": { - "description": "Output format of the module `Display`. See `-h format` for formatting syntax\n 1. {width}: Screen configured width (in pixels)\n 2. {height}: Screen configured height (in pixels)\n 3. {refresh-rate}: Screen configured refresh rate (in Hz)\n 4. {scaled-width}: Screen scaled width (in pixels)\n 5. {scaled-height}: Screen scaled height (in pixels)\n 6. {name}: Screen name\n 7. {type}: Screen type (Built-in, External or unknown)\n 8. {rotation}: Screen rotation (in degrees)\n 9. {is-primary}: True if being the primary screen\n 10. {physical-width}: Screen physical width (in millimeters)\n 11. {physical-height}: Screen physical height (in millimeters)\n 12. {inch}: Physical diagonal length in inches\n 13. {ppi}: Pixels per inch (PPI)\n 14. {bit-depth}: Bits per color channel\n 15. {hdr-enabled}: True if high dynamic range (HDR) mode is enabled\n 16. {manufacture-year}: Year of manufacturing\n 17. {manufacture-week}: Nth week of manufacturing in the year\n 18. {serial}: Serial number\n 19. {platform-api}: The platform API used when detecting the display\n 20. {hdr-compatible}: True if the display is HDR compatible\n 21. {scale-factor}: HiDPI scale factor\n 22. {preferred-width}: Screen preferred width (in pixels)\n 23. {preferred-height}: Screen preferred height (in pixels)\n 24. {preferred-refresh-rate}: Screen preferred refresh rate (in Hz)", + "description": "Output format of the module `Display`. See `-h format` for formatting syntax\n 1. {width}: Screen configured width (in pixels)\n 2. {height}: Screen configured height (in pixels)\n 3. {refresh-rate}: Screen configured refresh rate (in Hz)\n 4. {scaled-width}: Screen scaled width (in pixels)\n 5. {scaled-height}: Screen scaled height (in pixels)\n 6. {name}: Screen name\n 7. {type}: Screen type (Built-in or External)\n 8. {rotation}: Screen rotation (in degrees)\n 9. {is-primary}: True if being the primary screen\n 10. {physical-width}: Screen physical width (in millimeters)\n 11. {physical-height}: Screen physical height (in millimeters)\n 12. {inch}: Physical diagonal length in inches\n 13. {ppi}: Pixels per inch (PPI)\n 14. {bit-depth}: Bits per color channel\n 15. {hdr-enabled}: True if high dynamic range (HDR) mode is enabled\n 16. {manufacture-year}: Year of manufacturing\n 17. {manufacture-week}: Nth week of manufacturing in the year\n 18. {serial}: Serial number\n 19. {platform-api}: The platform API used when detecting the display\n 20. {hdr-compatible}: True if the display is HDR compatible\n 21. {scale-factor}: HiDPI scale factor\n 22. {preferred-width}: Screen preferred width (in pixels)\n 23. {preferred-height}: Screen preferred height (in pixels)\n 24. {preferred-refresh-rate}: Screen preferred refresh rate (in Hz)", "type": "string" }, "diskFormat": {