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/set present #159

Merged
merged 4 commits into from
Nov 11, 2022
Merged

Fix/set present #159

merged 4 commits into from
Nov 11, 2022

Conversation

ikaratass
Copy link
Collaborator

  • set_present_protocol_state method is awaitable.

if hasattr(self.comm_session, "evse_controller"):
await self.comm_session.evse_controller.set_present_protocol_state(
str(self.current_state)
)
# This will create the values needed for the next state, such as
# next_state, next_v2gtp_message, next_message_payload_type etc.
await self.process_message(message)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it might suffice to call set_present_protocol_state once after the above self.process_message?

                if hasattr(self.comm_session, "evse_controller"):
                    await self.comm_session.evse_controller.set_present_protocol_state(
                        # noqa
                        str(self.current_state)
                    )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

iso15118/shared/comm_session.py Show resolved Hide resolved
Comment on lines 492 to 495
if hasattr(self.comm_session, "evse_controller"):
await self.comm_session.evse_controller.set_present_protocol_state( # noqa
str(self.current_state.next_state.__name__)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be removed as discussed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@ikaratass ikaratass merged commit 79a3b79 into master Nov 11, 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.

2 participants