Explorar o código

correct the README where it drifted from the file and from the tool

Five claims were checked against definitions/impact80.json, against VIA's own
qmk_rgb_matrix menu, and against the tool running on the board, and each was
wrong. The claims are the ones an agent copies verbatim, so they were worth more
than their size suggested.

The opening line promised support for Impact 80 and Rainy 75 "out of the box".
Rainy 75 appears nowhere in the repository but a test fixture, no definition is
built in for it, and keyboards.json is gone, so it gets nothing out of the box
and needs `keyboard fetch` like any other board.

The Logo/Side effect table carried the tool's own spellings, `fixed_wave` and
`breathing`, where the file writes `fixed wave` and `breathe`. The document says
so correctly 200 lines earlier and again 40 lines after the table, in the next
section, so the table read as the board's own catalog and contradicted both. The
table now names both spellings. The Backlight table needed no change: there the
two agree, and all 46 names match the file.

The ID 46 example showed `info` printing one line. It prints two — the mode is
always the first line, and the example dropped it, so a reader could not tell
whether an unnamed effect leaves the field empty or absent.

The sentence explaining why the Impact 80 needs its own catalog said its list
"runs to 45 because it adds" five names. 45 plus 5 is 50, not 45, and the claim
is that the additions produce the count. Comparing the file against VIA's menu
settles it: the board also drops four names the menu has — pixel_rain,
pixel_fractal, typing_heatmap and solid_reactive_simple — so 45 − 4 + 5 = 46
ending at ID 45. Both halves are now named, so the arithmetic can be checked
instead of taken on trust.

Finally, `error` in a zone record carries `omitempty` and the document never said
so. A parser expecting `"error": null` reads a healthy zone as broken, and this
is the field an agent checks to decide whether it can trust a reading.
Paul-Dieter Klumpp hai 1 semana
pai
achega
364cca89f7
Modificáronse 1 ficheiros con 43 adicións e 17 borrados
  1. 43 17
      README.md

+ 43 - 17
README.md

@@ -1,6 +1,8 @@
 # QMK RGB Tool
 
-Control the RGB lighting on QMK-compatible keyboards. Supports Impact 80 and Rainy 75 out of the box, and any other keyboard running QMK with the RGB Matrix subsystem and VIA support.
+Control the RGB lighting on QMK-compatible keyboards. Any keyboard running QMK with a
+lighting channel and VIA support is driven; the Impact 80's effect names are built in,
+every other board's are fetched with `keyboard fetch`.
 
 Cross-platform CLI for Linux, macOS, and Windows. Designed for automation, scripting, and agent consumption.
 
@@ -102,6 +104,20 @@ fpath=("$HOME/.zsh/completions" $fpath)
 autoload -Uz compinit && compinit
 ```
 
+On macOS, a Homebrew install already puts a directory on `$fpath`, so the file
+needs no `.zshrc` change and no `compinit` re-run — writing it there is enough.
+The prefix depends on the architecture, so take the one `zsh` reports:
+
+```zsh
+print -l $fpath | grep zsh/site-functions
+qmk-rgb-tool completion zsh > /opt/homebrew/share/zsh/site-functions/_qmk-rgb-tool
+```
+
+The binary itself has to be on `$PATH` for any of this to offer more than command
+names. The generated script calls it back for every candidate and discards the
+error, so a binary that is missing degrades to plain file completion without a
+message.
+
 Open a new shell afterwards.
 
 The generated script is a shim: cobra's shells ask the running binary what to
@@ -302,6 +318,7 @@ so **ID 46 has no name and the tool does not invent one**:
 $ qmk-rgb-tool effect 46 --zone backlight
 Effect set to index 46
 $ qmk-rgb-tool info
+unknown
   Backlight    on   unknown                      brightness 255  speed 127  color hsv:0,255
 ```
 
@@ -390,9 +407,12 @@ as `All Off`, `NONE` or `00.NONE` depending on the vendor.
 That is why a catalog cannot be defaulted per subsystem, and it is the same
 reason the Impact 80 needs its own. Its backlight channel reorders IDs 15 to 17 —
 `cycle_out_in`, `cycle_out_in_dual`, then `rainbow_moving_chevron`, where the
-built-in list has `rainbow_moving_chevron` first — and its list runs to 45 because
-it adds `flower_blooming`, `starlight`, `starlight_dual_hue`, `starlight_dual_sat`
-and `riverflow`, none of which the built-in list has. A board can also be at an
+built-in list has `rainbow_moving_chevron` first. It also edits the set and not
+only the order: it drops four names the built-in list has — `pixel_rain`,
+`pixel_fractal`, `typing_heatmap` and `solid_reactive_simple` — and adds five it
+does not have: `flower_blooming`, `starlight`, `starlight_dual_hue`,
+`starlight_dual_sat` and `riverflow`. 45 − 4 + 5 = 46 names, ending at ID 45. A
+board can also be at an
 ID the built-in list does not name at all, and the source for that name is the
 board, not VIA:
 
@@ -450,7 +470,7 @@ those two channels is `[0, 4]`, not 0–255:
 |---:|---:|---|
 | `0` | `0` | the animation is frozen, the color stands still |
 | `1` | `1` | the slowest movement |
-| `2` and above | `4` | twice as fast; this is where every larger request lands |
+| `2` and above | `4` | where every larger request lands; the ratio to `1` has not been measured |
 
 The freeze at `0` was observed on `logo`; `side` reports the same range and the
 same collapse to 4. `backlight` is the only channel with a usable 0–255 range.
@@ -482,19 +502,22 @@ Those three display names come from the board's definition file, in the sub-menu
 it puts each channel under. The QMK subsystem names for the same channels are
 `rgblight`, `rgb_matrix` and `audio`, and both spellings work on this board.
 
-Logo and Side share this complete effect family:
+Logo and Side share this complete effect family. Two of these are the tool's own
+spellings: the file writes `fixed wave` and `breathe`, and `effect --list` prints
+the file's spelling.
 
-| ID | Name |
-|---:|---|
-| 0 | `none` |
-| 1 | `wave` |
-| 2 | `fixed_wave` |
-| 3 | `spectrum` |
-| 4 | `breathing` |
-| 5 | `light` |
-| 6 | `shutdown` |
+| ID | Name | In the file |
+|---:|---|---|
+| 0 | `none` | `none` |
+| 1 | `wave` | `wave` |
+| 2 | `fixed_wave` | `fixed wave` |
+| 3 | `spectrum` | `spectrum` |
+| 4 | `breathing` | `breathe` |
+| 5 | `light` | `light` |
+| 6 | `shutdown` | `shutdown` |
 
-Backlight uses the complete Impact 80 catalog:
+Backlight uses the complete Impact 80 catalog. Here the two spellings agree, so
+one column carries the whole list:
 
 | ID | Name | ID | Name |
 |---:|---|---:|---|
@@ -602,7 +625,10 @@ ID 39 is `multisplash`; ID 41 is the distinct `solid_multisplash` name.
 effect name and ID, brightness, speed, and color. The top-level `enabled`,
 `brightness` and `speed` fields summarize the first selected zone.
 If one zone cannot be queried, its record contains an `error`, other records
-are retained, and the process exits non-zero after printing the JSON.
+are retained, and the process exits non-zero after printing the JSON. `error`
+carries `omitempty`, so a zone that read fine has no `error` key at all rather
+than `"error": null` — a parser must treat a missing key and an empty string as
+"no error". Every other field above is always present.
 
 ## Platform Setup (udev rules and permissions)