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

Add support for subscriptions to all instances of an interface for subscribing to variables #217

Open
james-ctc opened this issue Nov 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@james-ctc
Copy link
Contributor

Currently you subscribe to a specific module instance for a particular interface.
e.g.

evse_manager->subscribe_session_event([](types::evse_manager::SessionEvent event) {...});

There can be more than one EVSE manager (up to 128) and each one would require:

  • a link in the charger YAML configuration file to the module wanting to subscribe
  • a separate subscription for each EVSE manager

The improvement is to allow a "wildcard" subscription so that a single subscribe would provide all session events regardless of which EVSE manager raised it.

e.g. a subscribe which provides the session event (variable) along with the EVSE manager ID that published it.

mqtt->subscribe_all_session_events([](const std::string &evse_manager_id, types::evse_manager::SessionEvent event) {...});

It might be possible to further generalise the approach so that other interface variables can be subscribed to without having to bind to a specific instance.

@james-ctc james-ctc added the enhancement New feature or request label Nov 6, 2024
@james-ctc
Copy link
Contributor Author

idea came from PR #215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant