diff --git a/notecard/card.py b/notecard/card.py index 95cfaf4..87138d6 100644 --- a/notecard/card.py +++ b/notecard/card.py @@ -858,7 +858,7 @@ def version(card, api=None): @validate_card_object -def voltage(card, alert=None, calibration=None, hours=None, mode=None, name=None, offset=None, set=None, sync=None, usb=None, vmax=None, vmin=None): +def voltage(card, alert=None, calibration=None, hours=None, mode=None, name=None, off=None, offset=None, on=None, set=None, sync=None, usb=None, vmax=None, vmin=None): """Provide the current V+ voltage level on the Notecard, and provides information about historical voltage trends. When used with the mode argument, configures voltage thresholds based on how the device is powered. Args: @@ -868,7 +868,9 @@ def voltage(card, alert=None, calibration=None, hours=None, mode=None, name=None hours (int): The number of hours to analyze, up to 720 (30 days). mode (str): Used to set voltage thresholds based on how the Notecard will be powered, and which can be used to configure voltage-variable Notecard behavior. Each value is shorthand that assigns a battery voltage reading to a given device state like `high`, `normal`, `low`, and `dead`. NOTE: Setting voltage thresholds is not supported on the Notecard XP. name (str): Specifies an environment variable to override application default timing values. + off (bool): Disable historic voltage trend calculations. offset (int): Number of hours to move into the past before starting analysis. + on (bool): Enable historic voltage trend calculations. set (bool): Used along with `calibration`, set to `true` to specify a new calibration value. sync (bool): When enabled and the `usb` argument is set to `true`, the Notecard will perform a sync when USB power is connected or disconnected. usb (bool): When enabled, the Notecard will monitor for changes to USB power state. @@ -889,8 +891,12 @@ def voltage(card, alert=None, calibration=None, hours=None, mode=None, name=None req["mode"] = mode if name: req["name"] = name + if off is not None: + req["off"] = off if offset is not None: req["offset"] = offset + if on is not None: + req["on"] = on if set is not None: req["set"] = set if sync is not None: diff --git a/notecard/note.py b/notecard/note.py index 774b1cd..ad447c7 100644 --- a/notecard/note.py +++ b/notecard/note.py @@ -27,7 +27,7 @@ def add(card, binary=None, body=None, file=None, full=None, key=None, limit=None 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. note (str): If the Notefile has a `.db/.dbs/.dbx` extension, specifies a unique Note ID. If `note` string is `"?"`, then a random unique Note ID is generated and returned as `{"note":"xxx"}`. If this argument is provided for a `.qo` Notefile, an error is returned. - payload (str): A base64-encoded binary payload. A Note must have either a `body` or a `payload`, and can have both. If a Note template is not in use, payloads are limited to 250 bytes. + payload (str): A base64-encoded binary payload. A Note must have either a `body` or a `payload`, and can have both. Payloads are limited to 256 bytes. sync (bool): Set to `true` to sync immediately. Only applies to outgoing Notecard requests, and only guarantees syncing the specified Notefile. Auto-syncing incoming Notes from Notehub is set on the Notecard with `{"req": "hub.set", "mode":"continuous", "sync": true}`. verify (bool): If set to `true` and using a templated Notefile, the Notefile will be written to flash immediately, rather than being cached in RAM and written to flash later.