Skip to content

Feat/allow passing answer from @on to @after hook#683

Open
OSkrk wants to merge 7 commits into
mobilityhouse:masterfrom
OSkrk:feat/allow_passing_answer_from_@on_to_@after_hook
Open

Feat/allow passing answer from @on to @after hook#683
OSkrk wants to merge 7 commits into
mobilityhouse:masterfrom
OSkrk:feat/allow_passing_answer_from_@on_to_@after_hook

Conversation

@OSkrk

@OSkrk OSkrk commented Nov 26, 2024

Copy link
Copy Markdown
Collaborator

This PR addresses the feature discussed here, allowing the response sent inside the @on to be passed to the @after hook for further processing (avoiding the use of temp variables). The feature enables the @after decorator to accept an inject_response parameter, which can be used to control whether the response from the _on_action handler is passed to the _after_action handler, and guarantees backwards compatibility.

@OrangeTux , @tropxy, @HugoJP1, @mdwcrft would like to know you guy's feedback on this.

Comment thread tests/test_charge_point.py Outdated

@astrand astrand 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.

Thanks for working on this!

Comment thread ocpp/charge_point.py Outdated
Comment thread ocpp/charge_point.py Outdated
Comment thread ocpp/routing.py
Comment thread ocpp/charge_point.py Outdated
Comment thread ocpp/charge_point.py Outdated
@OrangeTux

Copy link
Copy Markdown
Contributor

I don't have anything against this PR. I leave it up to the new maintainers to approve and merge it.

I'll have a call with the new maintainers this Friday and I'll bring this PR to the table.

mdwcrft and others added 3 commits June 4, 2026 18:41
…nse, fix enum

  - Refactor _handle_call to build kwargs dict and call handler() once (astrand/tropxy)
  - Rename injected kwarg on_response -> call_response (tropxy)
  - Document inject_response argument in after() docstring (tropxy)
  - Fix test to use snake_case Action.boot_notification (fixes failing CI)
@OSkrk OSkrk requested review from astrand and tropxy June 27, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants