-
Notifications
You must be signed in to change notification settings - Fork 99
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
New EVCC config isAliveAfterSession introduced #361
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -306,7 +306,7 @@ async def __init__. Therefore, we need to create a separate async | |||||||||||
|
||||||||||||
logger.info("Communication session handler started") | ||||||||||||
|
||||||||||||
await wait_for_tasks(self.list_of_tasks) | ||||||||||||
await wait_for_tasks(self.list_of_tasks, asyncio.ALL_COMPLETED) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't this stop the session from ending if say for instance the udp server fails to start? As self.get_from_rcv_queue() wouldn't have exited. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are right, |
||||||||||||
|
||||||||||||
async def send_sdp(self): | ||||||||||||
""" | ||||||||||||
|
@@ -550,7 +550,10 @@ async def get_from_rcv_queue(self, queue: asyncio.Queue): | |||||||||||
elif isinstance(notification, StopNotification): | ||||||||||||
await cancel_task(self.comm_session[1]) | ||||||||||||
del self.comm_session | ||||||||||||
if not notification.successful: | ||||||||||||
if notification.successful: | ||||||||||||
if not self.config.is_alive_after_session: | ||||||||||||
break | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following my suggestion from above, I think this would suffice. What do you think?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks good to me. Added another commit to fix all together. |
||||||||||||
else: | ||||||||||||
try: | ||||||||||||
await self.restart_sdp(True) | ||||||||||||
except SDPFailedError as exc: | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies I didn't clarify this under issues. As the user can't proceed until the session is killed anyway, I don't see much value in making this a configurable field. The behaviour you have added to gracefully exit is the only change required. Do you have a use case in mind where keeping the session alive would be useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't have any use case in mind for keeping the session alive. I wanted to keep the session by default and stop the session when the configuration is used. However, it seems like the new configuration key is not necessary as stopping session can be the default behavior👍. I personally think, evcc should be terminated as a default after session, because evcc is not starting a new session again.