Skip to content

Add text inventories of the HMI files, and a US/EU consistency check - #428

Open
jamesmulcahy wants to merge 4 commits into
NSPManager:develfrom
jamesmulcahy:feat/hmi-inventory
Open

jamesmulcahy wants to merge 4 commits into
NSPManager:develfrom
jamesmulcahy:feat/hmi-inventory

Conversation

@jamesmulcahy

Copy link
Copy Markdown
Contributor

The .HMI files are binary, so a PR that changes one shows nothing in review. #427 (screensaver2 replaced by cover in #419) is the kind of change that goes unnoticed as a result. This PR adds a text inventory of each HMI that is checked in CI, plus a check that the US and EU HMIs stay consistent.

What's here

1. docker/HMI_files/hmi_inventory.py: prints an HMI's pages, components, selected attributes and event code as text. It uses nextion-tools, pinned to a commit and run with uv run (PEP 723 inline dependencies, so nothing to install beyond uv).

  • Each HMI's inventory is committed next to it as gui.HMI.txt, about 5,200 lines each.
  • CI fails if a committed inventory doesn't match its HMI. An HMI change therefore has to carry a readable diff:
    -## page 4 screensaver2
    -[0] screensaver2  page  global
    +## page 4 cover
    +[0] cover  page
  • Fonts are shown by name and size, and pictures with their dimensions: font = 0 (hamlin18_latA 18), picc = 67 (320x480).
  • The attributes listed are an allowlist. Editor bookkeeping, and attributes that have the same value on every component, are left out. Any attribute the script doesn't recognise is printed.
  • Regenerate with uv run docker/HMI_files/hmi_inventory.py --write.

2. Local git diff of HMIs. .gitattributes marks *.HMI diff=hmi. After

git config diff.hmi.textconv "uv run --quiet docker/HMI_files/hmi_inventory.py"

git diff and git log -p show HMI changes as inventory diffs. GitHub ignores textconv, which is why the inventories are committed.

3. docker/HMI_files/hmi_compare.py: checks that the US and EU HMIs differ only where we know they do. It compares the two by page and component name and ignores, by rule:

  • position and size;
  • which picture is used, but not whether there is one;
  • font indices (fonts are compared by name and height instead);
  • ids of components that don't report touches;
  • comments in code.

Every other difference must be listed in hmi_us_eu_differences.txt, either as expected (with a reason) or todo. CI fails on an unlisted difference and on a listed one that no longer exists. Fixing a todo therefore means deleting its line, and the list can only shrink.

Needs review: the differences list

The list starts with 57 expected and 38 todo. The classification is my first pass and needs someone who knows the HMIs to correct it.

  • I marked as expected:
    • slider orientation;
    • display direction and lcd_dev;
    • fonts on buttons that draw no text;
    • the larger icon font on the EU's taller item buttons;
    • text alignment.
  • todo covers differences that look like one file got a change the other didn't, for example:
    • the US dropdown has no swipe to the thermostat page (tc0.val==18);
    • the US thermostat prev/next don't end a pending setpoint change (deactivatetemp);
    • the US items pages don't hide slider_save on load;
    • dropdown's item buttons are global on US and local on EU;
    • several txt_maxl mismatches.
  • todo also covers a few that may well be deliberate. These only need a reason to become expected.

Testing

  • --check and hmi_compare.py both pass on devel's HMIs.
  • hmi_compare.py fails with a usable message when a difference isn't listed, when a listed difference no longer exists, and when an expected entry has no reason.
  • The textconv shows Add cover entity support and dedicated panel page #419's HMI change as above.
  • ruff is clean.
  • The workflow itself runs for the first time on this PR.

🤖 Generated with Claude Code

jamesmulcahy and others added 3 commits November 7, 2026 18:44
The .HMI files are binary, so a PR that changes one shows nothing in review.
hmi_inventory.py (nextion-tools, run with uv) prints an HMI's pages, components,
selected attributes and event code as text. Each HMI's inventory is committed
next to it as <name>.HMI.txt, and CI fails when one no longer matches its HMI,
so an HMI change carries a readable diff.

.gitattributes marks *.HMI diff=hmi, so after

    git config diff.hmi.textconv "uv run --quiet docker/HMI_files/hmi_inventory.py"

git diff and git log -p show the same view locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated with: uv run docker/HMI_files/hmi_inventory.py --write

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hmi_compare.py compares the two projects by page and component name. It
allows by rule what follows from the different screens: position and size,
which picture is used (not whether there is one), font indices (fonts are
compared by name and height), ids of components that don't report touches,
and comments in code. Every other difference must be listed in
hmi_us_eu_differences.txt, as `expected` (with a reason) or `todo`.

CI fails on a difference that isn't listed, and on a listed one that has
gone, so fixing a todo means deleting its line and the list only shrinks.
It starts with 57 expected and 38 todo, among them the US dropdown's missing
swipe to the thermostat page and the US thermostat's prev/next not ending a
pending setpoint change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Updated expected values for various UI elements to reflect differences between US and EU layouts. Removed several todo items that are now expected.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants