chore: snapshot parsed HA action events for all supported devices - #33274
Open
stephanGarland wants to merge 1 commit into
Open
stephanGarland wants to merge 1 commit into
stephanGarland wants to merge 1 commit into
Conversation
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>
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. |
Collaborator
|
Agreed, better in ZHC, also because we'd have local control instead of relying on exported APIs. |
This branch has not been deployed
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.
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.