Skip to content

Commit

Permalink
Update note add helper to support port
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Johnson <[email protected]>
  • Loading branch information
drrk committed Apr 10, 2024
1 parent 5d46b80 commit d354640
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion notecard/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@validate_card_object
def add(card, file=None, body=None, payload=None, sync=None):
def add(card, file=None, body=None, payload=None, sync=None, port=None):
"""Add a Note to a Notefile.
Args:
Expand All @@ -23,6 +23,8 @@ def add(card, file=None, body=None, payload=None, sync=None):
body (JSON object): A developer-defined tracker ID.
payload (string): An optional base64-encoded string.
sync (bool): Perform an immediate sync after adding.
port (int): If provided, a unique number to represent a notefile.
Required for Notecard LoRa.
Returns:
string: The result of the Notecard request.
Expand All @@ -34,6 +36,8 @@ def add(card, file=None, body=None, payload=None, sync=None):
req["body"] = body
if payload:
req["payload"] = payload
if port:
req["port"] = port
if sync is not None:
req["sync"] = sync
return card.Transaction(req)
Expand Down

0 comments on commit d354640

Please sign in to comment.