From 81374f9f3f5dc1f726396c50b9f3c5fc5c5e658a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 22 Sep 2026 15:04:17 +0000 Subject: [PATCH] Update Notecard API from upstream schema changes (03c5498833605a459408a9cdfe12aff2295c3c36) --- notecard/card.py | 10 ++++++++-- notecard/hub.py | 2 +- notecard/note.py | 4 ++-- notecard/ntn.py | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/notecard/card.py b/notecard/card.py index 953e266..8e37881 100644 --- a/notecard/card.py +++ b/notecard/card.py @@ -433,13 +433,15 @@ def locationTrack(card, file=None, heartbeat=None, hours=None, payload=None, sta @validate_card_object -def monitor(card, count=None, mode=None, usb=None): +def monitor(card, count=None, mode=None, off=None, on=None, usb=None): """When a Notecard is in monitor mode, this API is used to configure the general-purpose `AUX1`-`AUX4` pins to test and monitor Notecard activity. Args: card (Notecard): The current Notecard object. - count (int): The number of pulses to send to the overridden AUX pin LED. Set this value to `0` to return the LED to its default behavior. + count (int): The number of pulses to send to the overridden AUX pin LED. To return the LED to its default behavior, use `"off": true` along with the `mode` of the LED. mode (str): Can be set to one of `green`, `red` or `yellow` to temporarily override the behavior of an AUX pin LED. See Using Monitor Mode for additional details. + off (bool): Set to `true`, along with a `mode`, to clear an override and return that AUX pin LED to its default behavior. + on (bool): Set to `true`, along with a `mode`, to turn that AUX pin LED on continuously. usb (bool): Set to `true` to configure LED behavior so that it is only active when the Notecard is connected to USB power. Returns: @@ -450,6 +452,10 @@ def monitor(card, count=None, mode=None, usb=None): req["count"] = count if mode: req["mode"] = mode + if off is not None: + req["off"] = off + if on is not None: + req["on"] = on if usb is not None: req["usb"] = usb return card.Transaction(req) diff --git a/notecard/hub.py b/notecard/hub.py index b7e48a8..c8b13a1 100644 --- a/notecard/hub.py +++ b/notecard/hub.py @@ -55,7 +55,7 @@ def set(card, align=None, details=None, duration=None, host=None, inbound=None, Args: card (Notecard): The current Notecard object. - align (bool): Use `true` to align syncs on a regular time-periodic cycle. The cycle is anchored to the Notecard's boot time, not to a wall-clock time. + align (bool): Use `true` to align syncs on a regular time-periodic cycle. The cycle is anchored to the moment the Notecard first obtained valid time after booting, not to a wall-clock time. details (str): When using Notecard LoRa you can use this argument to provide information about an alternative LoRaWAN server or service you would like the Notecard to use. The argument you provide must be a JSON object with three keys, "deveui", "appeui", and "appkey", all of which are hexadecimal strings with no leading 0x. For example: `{"deveui":"0080E11500088B37","appeui":"6E6F746563617264","appkey":"00088B37"}` The LoRaWAN details you send to a Notecard become part of its permanent configuration, and survive factory resets. You can reset a Notecard's LoRaWAN details to its default values by providing a `"-"` for the details argument. duration (int): When in `continuous` mode, the amount of time, in minutes, of each session (the minimum allowed value is `15`). When this time elapses, the Notecard gracefully ends the current session and starts a new one in order to sync session-specific data to Notehub. host (str): The URL of the Notehub service. Use `"-"` to reset to the default value. diff --git a/notecard/note.py b/notecard/note.py index f5484c3..26b2ed1 100644 --- a/notecard/note.py +++ b/notecard/note.py @@ -22,7 +22,7 @@ def add(card, binary=None, body=None, file=None, full=None, key=None, limit=None body (dict): A JSON object to be enqueued. A Note must have either a `body` or a `payload`, and can have both. file (str): The name of the Notefile. On Notecard LoRa this argument is required. On all other Notecards this field is optional and defaults to `data.qo` if not provided. When using this request on the Notecard the Notefile name must end in one of: `.qo` for a queue outgoing (Notecard to Notehub) with plaintext transport `.qos` for a queue outgoing with encrypted transport `.db` for a bidirectionally synchronized database with plaintext transport `.dbs` for a bidirectionally synchronized database with encrypted transport `.dbx` for a local-only database full (bool): If set to `true`, and the Note is using a Notefile Template, the Note will bypass usage of omitempty and retain `null`, `0`, `false`, and empty string `""` values. - key (str): The name of an environment variable in your Notehub.io project that contains the contents of a public key. Used when encrypting the Note body for transport. + key (str): The name of an environment variable in your Notehub project that contains the contents of a public key. Used when encrypting the Note body for transport. Note body encryption is not supported on Notecard for LoRa. limit (bool): If set to `true`, the Note will not be created if Notecard is in a penalty box. live (bool): If `true`, bypasses saving the Note to flash on the Notecard. Required to be set to `true` if also using `"binary":true`. max (int): Defines the maximum number of queued Notes permitted in the specified Notefile (`"file"`). Any Notes added after this value will be rejected. When used with `"sync":true`, a sync will be triggered when the number of pending Notes matches the `max` value. @@ -129,7 +129,7 @@ def get(card, decrypt=None, delete=None, deleted=None, file=None, note=None): Args: card (Notecard): The current Notecard object. - decrypt (bool): `true` to decrypt encrypted inbound Notefiles. + decrypt (bool): `true` to decrypt encrypted inbound Notefiles. Notefile decryption is not supported on Notecard for LoRa. delete (bool): `true` to delete the Note after retrieving it. deleted (bool): `true` to allow retrieval of a deleted Note. file (str): The Notefile name must end in `.qi` (for plaintext transport), `.qis` (for encrypted transport), `.db` or `.dbx` (for local-only DB Notefiles). diff --git a/notecard/ntn.py b/notecard/ntn.py index 8aa2e57..5b937a0 100644 --- a/notecard/ntn.py +++ b/notecard/ntn.py @@ -28,7 +28,7 @@ def config(card): @validate_card_object def gps(card, off=None, on=None): - """On a Notecard paired with a Starnote, this controls whether the Starnote uses a location known to the paired Notecard instead of acquiring one with its own GPS/GNSS module. It does not, by default. On Notecard for Skylo, the satellite radio and the GPS/GNSS are part of the same module. This request controls whether the Notecard uses a known location (typically a fixed location set with `card.location.mode`), instead of acquiring a new location for NTN use. + """On a Notecard paired with a Starnote, this controls whether the Notecard supplies a location it already knows to the Starnote for satellite use. It does not, by default. On Notecard for Skylo, the satellite radio and the GPS/GNSS are part of the same module. This request controls whether the Notecard uses a known location (typically a fixed location set with `card.location.mode`), instead of acquiring a new location for NTN use. Args: card (Notecard): The current Notecard object.