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 for SmartCharging Offline Behavior #783

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

Conversation

Pietfried
Copy link
Contributor

@Pietfried Pietfried commented Sep 10, 2024

Describe your changes

Added configuration variable to 1.6 and 2.0.1 to allow ignoring profile in case the charging station is offline when the composite schedules are calculated by requests of a libocpp consumer application

Issue ticket number and link

#781

Checklist before requesting a review

@Pietfried Pietfried linked an issue Sep 10, 2024 that may be closed by this pull request
Copy link
Contributor

@james-ctc james-ctc left a comment

Choose a reason for hiding this comment

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

a few questions and suggestions.
looks okay to me.

"IgnoredProfilePurposesOffline": {
"$comment": "Allows configuration of comma seperated list of ChargingProfilePurposes that are ignored in the composite schedule caluclation when offline.",
"type": "string",
"readOnly": true
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the CSMS be allowed to update this?

lib/ocpp/v16/charge_point_configuration.cpp Outdated Show resolved Hide resolved
lib/ocpp/v16/charge_point_configuration.cpp Outdated Show resolved Hide resolved
lib/ocpp/v16/smart_charging.cpp Outdated Show resolved Hide resolved
this->device_model->get_optional_value<std::string>(ControllerComponentVariables::IgnoredProfilePurposesOffline)
.value_or(""),
this->is_offline());
return this->get_composite_schedule_internal(request, purposes_to_ignore);
Copy link
Contributor

Choose a reason for hiding this comment

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

is there an EVerest style guide covering the use of this->?
it is often needed in lambdas but here it shouldn't be needed.

Copy link
Contributor Author

@Pietfried Pietfried Sep 21, 2024

Choose a reason for hiding this comment

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

There is no such style guide (yet). Im coming from java (where this is required) and personally like it to explicitly mark the members.

Copy link
Contributor

Choose a reason for hiding this comment

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

in a previous role member vars were prefixed with m_
Thank you for confirming there is no style guild. I have a PR where I was being asked to add this-> which at the moment is up to developer discretion.

lib/ocpp/v201/utils.cpp Outdated Show resolved Hide resolved
…le in case the charging station is offline when the composite schedules are calculated by requests of a libocpp consumer application

Signed-off-by: pietfried <[email protected]>
Signed-off-by: pietfried <[email protected]>
* Made IgnoredProfilePurposesOffline ReadWrite
* In OCPP1.6 calling signal_set_charging_profiles_callback also in case of websocket connect or disconnect in case IgnoredProfilePurposesOffline are empty, since this can influence the composite schedules
* Fixed r/w of IgnoredProfilePurposesOffline in charge_point_configuration
@Pietfried Pietfried force-pushed the feature/smart-charging-offline-behavior branch from 3e0a300 to e977303 Compare September 21, 2024 15:21
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.

Offline behavior for SmartCharging
3 participants