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

Rename charging profile callbacks #787

Open
Pietfried opened this issue Sep 12, 2024 · 1 comment · May be fixed by #981
Open

Rename charging profile callbacks #787

Pietfried opened this issue Sep 12, 2024 · 1 comment · May be fixed by #981
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Pietfried
Copy link
Contributor

OCPP Version

OCPP1.6, OCPP2.0.1

Describe the problem

Looking at how the signal_set_charging_profiles_callback and also set_charging_profiles_callback (of ocpp201) I would suggest to change the name of these variables to better represent their purpose. A libocpp user should get notified in case profiles are added / removed which leads to a change of the composite schedule. This can happen when charging profiles are added by SetChargingProfile.req but also when transactions stop (because TxProfiles) might be removed.

Describe your solution

A more appropriate name would e.g. be charging_profiles_updated_callback.

Additional context

No response

@thenaserov
Copy link

Rename the callbacks to charging_profiles_updated_callback. This name better reflects the actual purpose of the callback, which is to notify the user whenever the charging profiles are updated, regardless of the source of the update.

Rename the Callbacks:
Replace signal_set_charging_profiles_callback with charging_profiles_updated_callback.
Replace set_charging_profiles_callback with charging_profiles_updated_callback.

Update Documentation:
Ensure that the documentation clearly explains that the charging_profiles_updated_callback is triggered whenever there is a change in the charging profiles, including additions, removals, or modifications.

Backward Compatibility:
If the library is already in use, consider deprecating the old names and providing a transition period where both names are supported. This will give users time to update their code.

Testing:
After renaming, thoroughly test the library to ensure that the callback is triggered correctly in all scenarios where charging profiles are updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants