fix(cli): report all config packets in info via a table-driven renderer - #150
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
`info` enumerated fields by hand, so every packet added to GlobalConfig since the command was written went unreported. It covered 9 of the 15 packet types in the canonical schema (Web toolbox config.yaml, minor 4), and rendered several values as raw ids that mean nothing to a reader. Never reported until now: 0x24 data_bus 0x28 touch_controller 0x29 passive_buzzer 0x2a nfc_config 0x2b flash_config 0x2c data_extended Field-level gaps: PIPE_WRITE (transmission_modes bit 0x10) was missing from the mode list, so a device advertising sliding-window support looked like it lacked it; partial_update_support and display_technology were never shown; resolution printed width only. Replace the three hand-written layers with a declarative spec (_INFO_SECTIONS / _INFO_LIST_SECTIONS) that both the tree and the --json output walk, so new packets surface without a new branch per field. Make opaque values readable: add PANEL_IC_NAMES (112 panel ids) and DisplayTechnology to models/enums.py, generated from the same config.yaml the Config Builder renders from, so both tools describe a panel identically. Unknown panel ids still fall back to the raw hex. Wire up BinaryInputType (present but unused) and spell out the partial-update modes. JSON output stays backward compatible: existing keys keep their names and values (sleep_timeout_s stays seconds, deep_sleep_* stay numeric-or-null); new keys are additive. Adds tests/unit/test_cli_info_report.py -- the first test coverage for the CLI, which had none. Verified against five devices spanning three MCU families, five panels and three colour schemes: reTerminal E1003 (ESP32-S3; touch, buzzer, bus, identity, PIPE_WRITE), Spectra picture frame (nRF52840, BWGBRY), 2.6" and 3.5" Solum M3 (EFR32BG22; NFC + flash) and EN05 (USB-powered, FULL_FRAME partial support).
The info-report tests exercised no config with LEDs, sensors or WiFi, so _led_name, _sensor_name, _wifi_encryption, _wifi_server and the deep-sleep tree label went unrun (codecov flagged 21 uncovered lines on the patch). Adds cases for those paths plus the unknown-value fallbacks for LED type, WiFi encryption and partial-update support, which are what keep an unrecognised id rendering as hex instead of crashing. Patch coverage 90% -> 99%; the two remaining lines are defensive guards made unreachable by the section availability gates.
g4bri3lDev
force-pushed
the
fix/info-table-driven-config-report
branch
from
July 30, 2026 17:46
5b3adad to
9ca7b05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
infoenumerated config fields by hand, so packets added toGlobalConfigsince the command was written were never reported. It covered 9 of the 15 packet types in the canonical schema, and printed several values as raw ids.Never reported — four of them populated on hardware I have here:
0x24data_bus0x2anfc_config0x28touch_controller0x2bflash_config0x29passive_buzzer0x2cdata_extendedField-level gaps: PIPE_WRITE (
transmission_modesbit0x10) was missing from the mode list, so a device advertising sliding-window support looked like it lacked it;partial_update_supportanddisplay_technologywere never shown; resolution printed width only (1872px).Approach
Replaced the three hand-written layers with a declarative spec (
_INFO_SECTIONS/_INFO_LIST_SECTIONS) that both the tree and--jsonwalk, so a new packet needs a spec entry rather than a new branch in each renderer.Opaque values now resolve to names:
PANEL_IC_NAMES(112 panel ids) andDisplayTechnologyare generated from the sameconfig.yamlthe Config Builder renders from, so both tools describe a panel identically. Unknown ids still fall back to raw hex (tested). Also wired upBinaryInputType, which existed but was unused.Before / after on a reTerminal E1003:
Compatibility
--jsonis additive only: existing keys keep their names and values —sleep_timeout_sstays seconds (not the raw ms),deep_sleep_*stay numeric-or-null. Pinned by tests, since the restructure broke all three of those before they were caught.Testing
Adds
tests/unit/test_cli_info_report.py— 29 tests, and the first test coverage for the CLI, which had none. Full suite 892 passing;prek run --all-filesclean.Verified against five devices — three MCU families, five panels, three colour schemes:
0x0bb8)0x0023)0x001c)0x0036)0x0027)Every panel id resolved to a real name, and packets absent from a device stayed absent from its report.