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
feat: com aux able to receive timestamps #466
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
Version ongoing | ||
--------------- | ||
|
||
Communication Auxiliary | ||
^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Receive method of the Communication Auxiliary can now also return the message timestamp | ||
if the corresponding parameter is set to True. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -136,6 +136,7 @@ def receive_message( | |||||
self, | ||||||
blocking: bool = True, | ||||||
timeout_in_s: float = None, | ||||||
receive_timestamp: bool = False, | ||||||
) -> Optional[bytes]: | ||||||
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.
Suggested change
|
||||||
"""Receive a raw message. | ||||||
|
||||||
|
@@ -167,9 +168,12 @@ def receive_message( | |||||
|
||||||
msg = response.get("msg") | ||||||
remote_id = response.get("remote_id") | ||||||
timestamp = response.get("timestamp") | ||||||
|
||||||
# stay with the old return type to not making a breaking change | ||||||
if remote_id is not None: | ||||||
if receive_timestamp: | ||||||
return (msg, remote_id, timestamp) | ||||||
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. That's still a breaking change, or am I missing something? 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. Please add an additional keyword argument |
||||||
elif remote_id and not receive_timestamp: | ||||||
return (msg, remote_id) | ||||||
return msg | ||||||
|
||||||
|
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.
Parameter docstring is missing 🙈
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.
Ouuups, sorry I was trying to be quick so it can be merge before 0.28.0 🚑