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

fix: Schedule entry durations in ChargeParameterDiscoveryRes should add up to departure_time from EVCC (AB#2183) #59

Merged
merged 5 commits into from
Jun 9, 2022

Conversation

shalinnijel2
Copy link
Contributor

@shalinnijel2 shalinnijel2 commented Jun 8, 2022

  • Added a validation function to check if the schedule returned by the secondary actor is valid
  • V2G2-303 doesn't seem to be strict though - as V2G2-305 provides provision to EVCC to renegotiate a new schedule in case duration/sales tariff needs are not met.
  • Added tests for V2G2-303, V2G2-304 and V2G2-761

fix #44

Address V2G2-303, V2G2-304, V2G2-305, V2G2-721
@shalinnijel2 shalinnijel2 changed the title fix: Sum of durations in schedule entries must match departure_time from EVCC (AB#2183) fix: Schedule entry durations in ChargeParameterDiscoveryRes should add up to departure_time from EVCC (AB#2183) Jun 8, 2022
@shalinnijel2 shalinnijel2 requested a review from tropxy June 8, 2022 12:55
Copy link
Contributor

@tropxy tropxy left a comment

Choose a reason for hiding this comment

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

check it out

iso15118/secc/controller/simulator.py Show resolved Hide resolved
iso15118/secc/states/iso15118_2_states.py Outdated Show resolved Hide resolved
iso15118/secc/states/iso15118_2_states.py Outdated Show resolved Hide resolved
Comment on lines 110 to 122
for schedule_tuples in sa_schedule_tuples:
assert schedule_tuples.p_max_schedule is not None
schedule_duration = 0
if schedule_tuples.p_max_schedule.schedule_entries is not None:
start_time = schedule_tuples.p_max_schedule.schedule_entries[
0
].time_interval.start

for entry in schedule_tuples.p_max_schedule.schedule_entries:
schedule_duration += entry.time_interval.start - start_time
if entry.time_interval.duration is not None:
schedule_duration += entry.time_interval.duration
start_time = entry.time_interval.start
Copy link
Contributor

Choose a reason for hiding this comment

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

following the same comment as before, I think we can get the last and first entry and do the calculation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above - have done the mod.

tests/secc/states/test_iso15118_2_states.py Outdated Show resolved Hide resolved
tests/secc/states/test_messages.py Outdated Show resolved Hide resolved
@shalinnijel2 shalinnijel2 merged commit a2b27fa into master Jun 9, 2022
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.

Validation of the Schedule created in ChargeParameterDiscoveryRes
2 participants