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

Smart Charging: Expand add profile capabilities #682

Merged
merged 22 commits into from
Jul 24, 2024

Conversation

couryrr-afs
Copy link
Contributor

Describe your changes

  • Added logic to replace existing non-external constraint charging profiles
  • Added logic to verify TX Default charging profile evse placement.
  • Added test to cover required callbacks.

Issue ticket number and link

Checklist before requesting a review

@couryrr-afs
Copy link
Contributor Author

@shankari this is ready for your review.

Copy link

@shankari shankari left a comment

Choose a reason for hiding this comment

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

This is a fairly simple change and my comments are primarily focused on improved documentation, so I am approving this. Please do address my comments before sending it off to the community for merging. Documentation clarity is just as important, particularly in open source projects, where contributors can join and leave, as code.

@couryrr-afs couryrr-afs force-pushed the feature/k01-add-profile branch 2 times, most recently from dbe9afb to 5d7919c Compare July 3, 2024 14:13
Copy link

@shankari shankari left a comment

Choose a reason for hiding this comment

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

One more clarifying question....

Comment on lines +1246 to +1247
| K01.FR.14 | | |
| K01.FR.15 | | |
Copy link

Choose a reason for hiding this comment

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

These are not addressed in this PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were addressed with the check here

@couryrr-afs couryrr-afs force-pushed the feature/k01-add-profile branch 2 times, most recently from 5d7919c to 18f3f28 Compare July 8, 2024 17:21
@couryrr-afs couryrr-afs marked this pull request as ready for review July 8, 2024 17:22
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.

I have some comments/questions. Not sure if there are any actual changes needed but would like some answers at least before approving.

Comment on lines 972 to 992
TEST_F(ChargepointTestFixtureV201,
K01FR05_IfProfileWithSameIdExistsAndIsChargingStationExternalContraints_ThenProfileIsAppended) {

auto profile1 =
create_charging_profile(DEFAULT_PROFILE_ID, ChargingProfilePurposeEnum::ChargingStationExternalConstraints,
create_charge_schedule(ChargingRateUnitEnum::A), uuid(),
ChargingProfileKindEnum::Absolute, DEFAULT_STACK_LEVEL);
auto profile2 = create_charging_profile(DEFAULT_PROFILE_ID, ChargingProfilePurposeEnum::TxProfile,
create_charge_schedule(ChargingRateUnitEnum::A), uuid(),
ChargingProfileKindEnum::Absolute, DEFAULT_STACK_LEVEL);

auto sut1 = handler.add_profile(DEFAULT_EVSE_ID, profile1);
auto sut2 = handler.add_profile(DEFAULT_EVSE_ID, profile2);

auto profiles = handler.get_profiles();

EXPECT_THAT(sut1.status, testing::Eq(ChargingProfileStatusEnum::Accepted));
EXPECT_THAT(sut2.status, testing::Eq(ChargingProfileStatusEnum::Accepted));
EXPECT_THAT(profiles, testing::Contains(profile1));
EXPECT_THAT(profiles, testing::Contains(profile2));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on the need for profile_ids to be unique. This test seems to be validating an invalid case.

Copy link
Contributor

Choose a reason for hiding this comment

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

With the latest update we've removed this test.

@couryrr-afs couryrr-afs deleted the feature/k01-add-profile branch July 23, 2024 16:15
@couryrr-afs couryrr-afs restored the feature/k01-add-profile branch July 23, 2024 16:31
@couryrr-afs couryrr-afs reopened this Jul 23, 2024
Clarify where the existing profiles in the FR05
tests are.

Signed-off-by: Christopher Davis <[email protected]>
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.

Except for 2 small comments this looks good. The comments are relatively minor and I can accept to merge this as is and fix those later if you want to.

christopher-davis-afs and others added 3 commits July 24, 2024 12:18
We don't need a try-catch actually

Signed-off-by: Christopher Davis <[email protected]>
Signed-off-by: Coury Richards <[email protected]>
@couryrr-afs couryrr-afs force-pushed the feature/k01-add-profile branch from 4b49b17 to 570bd0c Compare July 24, 2024 14:02
@marcemmers marcemmers merged commit 01f064f into EVerest:main Jul 24, 2024
4 checks passed
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.

7 participants