generated from pufereq/python-template
chore(message.py): add target_id argument to Message.ack classmethod
This commit is contained in:
@@ -117,14 +117,19 @@ class Message:
|
|||||||
return cls.from_json(data.decode("utf-8"))
|
return cls.from_json(data.decode("utf-8"))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def ack(cls) -> Message:
|
def ack(cls, target_id: str) -> Message:
|
||||||
"""Create an ACK message.
|
"""Create an ACK message.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
target_id (str): The ID of the message to acknowledge.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Message: The created ACK message.
|
Message: The created ACK message.
|
||||||
"""
|
"""
|
||||||
return cls(
|
return cls(
|
||||||
category=Category.CONTROL, action=ControlAction.ACK, payload={}
|
category=Category.CONTROL,
|
||||||
|
action=ControlAction.ACK,
|
||||||
|
payload={"target_id": target_id},
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user