Skip to content

test: a keypad press reaches the bus, not just the funnel - #1517

Merged
raman325 merged 1 commit into
v6from
fix/v6-provider-cleanup
Aug 29, 2026
Merged

test: a keypad press reaches the bus, not just the funnel#1517
raman325 merged 1 commit into
v6from
fix/v6-provider-cleanup

Conversation

@raman325

Copy link
Copy Markdown
Owner

Breaking change

None.

Proposed change

Two loose ends from a provider-layer review of #1514, both artifacts of the lock_state_changed removal.

A keypad press is now tested to the bus, not just to the funnel. The three zwave_js notification tests were converted in this PR from capturing a real event to zwave_js_lock.async_fire_code_slot_event = MagicMock(). That proves the provider's notification decoding calls the funnel, but not that anything reaches the bus — and the funnel is deliberately silent for a slot no entry manages, which is exactly what those tests configure (CONF_SLOTS: {}). So after that change, nothing anywhere proved a zwave_js keypad press produces a credential_used event.

This adds one end-to-end test on the existing fully-set-up lcm_config_entry fixture. It asserts the payload names the person, so a mis-decoded slot surfaces as the wrong user's name rather than a number — mutation-verified by offsetting the decoded userId, which fails with assert 'slot2' == 'slot1'.

I did not convert the other three back: they cover the decoding branches cheaply and correctly at that level. The gap was that nothing sat above them.

_process_notification's topic parameter is dead. Its only use was source_data={"topic": topic, ...}, deleted with the event. Sibling of the OPERATION_SOURCE_NAMES constant already removed; an unused-argument diff across all nine providers between main and v6 says this is the last one.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • Full suite green at 100% coverage (2311); prek clean.
  • A separate, more serious provider finding from the same review is pre-existing on main, not a v6 regression, and is filed separately rather than bundled here.

The three notification tests stop at async_fire_code_slot_event, so
nothing proved a zwave_js keypad press produces the credential_used
event consumers actually subscribe to -- and the funnel stays silent for
a slot no entry manages, which is what those tests configure. Adds one
end-to-end assertion on the provider whose decoding is most intricate; a
mis-decoded slot now surfaces as the wrong person's name.

Also drops the topic parameter _process_notification no longer reads,
dead since the lock_state_changed removal took its only use.

Entire-Checkpoint: 48f01fec5966
Copilot AI lite review requested due to automatic review settings August 29, 2026 02:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added python Pull requests that update Python code breaking-change Pull requests that break existing functionality code-quality Pull requests that improve code quality labels Aug 29, 2026
@raman325
raman325 merged commit c9aca35 into v6 Aug 29, 2026
5 checks passed
@raman325
raman325 deleted the fix/v6-provider-cleanup branch August 29, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Pull requests that break existing functionality code-quality Pull requests that improve code quality python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants