Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControllerApplication.on_request looks like dead code #58

Open
grant-allan-ctct opened this issue Dec 5, 2023 · 0 comments
Open

ControllerApplication.on_request looks like dead code #58

grant-allan-ctct opened this issue Dec 5, 2023 · 0 comments

Comments

@grant-allan-ctct
Copy link
Collaborator

The public function on_request on the ControllerApplication class here does nothing and is never called.

    def on_request(self, src_address, dest_address, pgn):
        """Callback for PGN requests
        :param int src_address:
            The address the request comes from
        :param int dest_address:
            The address the request was sent to; normally ours, but can also be GLOBAL
        :param int pgn:
            Parameter Group Number requested
        """
        pass

It seems like in the times gone by, a consumer was expected to subclass the ControllerApplication class and then override this function. You can see that in this line in the original benkfra project. The new way is instead to inject a subscriber using subscribe_request, but the on_request function missed out on deletion when that changed.

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

No branches or pull requests

1 participant