Skip to content

chore: snapshot parsed HA action events for all supported devices - #33274

Open
stephanGarland wants to merge 1 commit into
Koenkk:devfrom
stephanGarland:test/ha-action-events-snapshot
Open

stephanGarland wants to merge 1 commit into
Koenkk:devfrom
stephanGarland:test/ha-action-events-snapshot

Conversation

@stephanGarland

Copy link
Copy Markdown
Contributor

This is in response to this discussion about #33048 being a surprise breaking change.

I'm open to other approaches, e.g. making this an advisory check, since there are certainly legitimate reasons to introduce a breaking change. In any case, I think making the changes visible to the developer would be useful.

Example output snippet when ran against the latest release:

+ down_single {"action":"single","button":"down"}
+ up_double {"action":"double","button":"up"}
+ config_single {"action":"single","button":"config"}
+ left_single {"action":"single","button":"left"}
+ on_double {"action":"double","button":"on"}
+ slider_single {"action":"single","button":"slider"}
+ 1_single {"action":"single","button":"1"}
+ scene_4 {"action":"scene","scene":"4"}
- button_5_hold {"action":"hold","button":"button_5"}

There is a fair amount of noise due to how vitest builds diffs; this could be probably be parsed to only show actual changes in CI output.

Description written by me, code authored by Claude; actual new code is +30 lines, the rest is the test's generated snapshot. Still well under the 500-line limit for AI contribution.

Home Assistant automations match on an event entity's event_type and
attributes, so changing how ACTION_PATTERNS splits an existing action
value is a breaking change for every device exposing it. Koenkk#33048 split
`<button>_single`/`_double` into event_type + `button`, which changed
e.g. Inovelli VZM30/31/35 `down_single` -> `single` + `button: down`,
plus `left_single`, `on_double`, `center_single`, `slider_single`, ...
none of which the existing hand-picked parse cases cover.

Walk every zhc definition (the same way the duplicate type/object_id
test does), parse each action enum value, and snapshot the values that
are rewritten. Values parsed as-is are omitted to keep the file small;
one that starts being split shows up as an added line, so the blast
radius of a pattern change is visible in review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Koenkk

Koenkk commented Oct 4, 2026

Copy link
Copy Markdown
Owner

I like the idea, but I think it should move closer to the source of the change (to zigbee-herdsman-converters). Then we can have the CI immediately failing when this happens.

@Nerivec

Nerivec commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Agreed, better in ZHC, also because we'd have local control instead of relying on exported APIs.
Should also probably be extended to support other aspects in ZHC that have a tendency to create undesired breaking changes (expose, options, etc.).

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.

3 participants