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

Feature/move smart charging handlers and callbacks to functional block #957

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

maaikez
Copy link
Contributor

@maaikez maaikez commented Jan 28, 2025

Describe your changes

Move smart charging handlers and callbacks to a new smart charging functional block.

Issue ticket number and link

#953

Checklist before requesting a review

Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
… the same class). Fix tests.

Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
@maaikez maaikez force-pushed the feature/move-smart-charging-handlers-and-callbacks-to-functional-block branch from 702147a to e95572a Compare January 29, 2025 16:45
Copy link
Contributor

@marcemmers marcemmers left a comment

Choose a reason for hiding this comment

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

Mainly would like to see those 2 get_composite_schedule functions remain. The other two are really just nits so do with them what you want ;)

Comment on lines +74 to +75
virtual ~SmartChargingInterface() {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
virtual ~SmartChargingInterface() {
}
virtual ~SmartChargingInterface() = default;

I would just leave it like this

/// \param duration How long the schedule should be
/// \param unit ChargingRateUnit to thet the schedule for
/// \return the composite schedule if the operation was successful, otherwise nullopt
virtual std::optional<CompositeSchedule> get_composite_schedule(int32_t evse_id, std::chrono::seconds duration,
Copy link
Contributor

Choose a reason for hiding this comment

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

I can imagine consumers don't always need to get all the schedules so it might be better to leave these in. We use the latter of these function to get a schedule.

@@ -200,7 +200,7 @@ std::vector<ChargingProfilePurposeEnum> get_purposes_to_ignore(const std::string
std::vector<ChargingProfilePurposeEnum> purposes_to_ignore;
const auto purposes_to_ignore_vec = split_string(csl, ',');

for (const auto purpose : purposes_to_ignore_vec) {
for (const auto& purpose : purposes_to_ignore_vec) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a vector of enums, so no need to take by reference (enum is only 4 bytes anyway)

@marcemmers marcemmers self-assigned this Jan 31, 2025
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

Successfully merging this pull request may close these issues.

Move 'Smart Charging' handlers and callbacks to functional block
2 participants