Skip to content

Commit 6ad2318

Browse files
Update Notecard API from upstream schema changes (42ce1d133af212f962a7bea39ee71ada24c6429b) (#125)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 3a63d3e commit 6ad2318

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

notecard/card.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def version(card, api=None):
858858

859859

860860
@validate_card_object
861-
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):
861+
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):
862862
"""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.
863863
864864
Args:
@@ -868,7 +868,9 @@ def voltage(card, alert=None, calibration=None, hours=None, mode=None, name=None
868868
hours (int): The number of hours to analyze, up to 720 (30 days).
869869
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.
870870
name (str): Specifies an environment variable to override application default timing values.
871+
off (bool): Disable historic voltage trend calculations.
871872
offset (int): Number of hours to move into the past before starting analysis.
873+
on (bool): Enable historic voltage trend calculations.
872874
set (bool): Used along with `calibration`, set to `true` to specify a new calibration value.
873875
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.
874876
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
889891
req["mode"] = mode
890892
if name:
891893
req["name"] = name
894+
if off is not None:
895+
req["off"] = off
892896
if offset is not None:
893897
req["offset"] = offset
898+
if on is not None:
899+
req["on"] = on
894900
if set is not None:
895901
req["set"] = set
896902
if sync is not None:

0 commit comments

Comments
 (0)