Skip to content

Commit 2735f24

Browse files
Update Notecard API from upstream schema changes (e753e2c29e6e14695445e88f32c04ec89ab57af9) (#144)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 16f7ae5 commit 2735f24

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

notecard/card.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def restore(card, connected=None, delete=None):
652652
Args:
653653
card (Notecard): The current Notecard object.
654654
connected (bool): Set to `true` to reset the Notecard on Notehub. This will delete and deprovision the Notecard from Notehub the next time the Notecard connects. This also removes any Notefile templates used by this device. Conversely, if `connected` is `false` (or omitted), the Notecard's settings and data will be restored from Notehub the next time the Notecard connects to the previously used Notehub project.
655-
delete (bool): Set to `true` to reset most Notecard configuration settings. Note that this does not reset stored Wi-Fi credentials or the alternate I2C address (if previously set) so the Notecard can still contact the network after a reset. The Notecard will be unable to sync with Notehub until the `ProductUID` is set again.
655+
delete (bool): Set to `true` to reset most Notecard configuration settings. Note that this does not reset stored WiFi credentials or the alternate I2C address (if previously set) so the Notecard can still contact the network after a reset. The Notecard will be unable to sync with Notehub until the `ProductUID` is set again.
656656
657657
Returns:
658658
dict: The result of the Notecard request.
@@ -764,16 +764,16 @@ def transport(card, allow=None, method=None, seconds=None, umin=None):
764764

765765
@validate_card_object
766766
def triangulate(card, minutes=None, mode=None, on=None, set=None, text=None, time=None, usb=None):
767-
"""Enable or disables a behavior by which the Notecard gathers information about surrounding cell towers and/or Wi-Fi access points with each new Notehub session.
767+
"""Enable or disables a behavior by which the Notecard gathers information about surrounding cell towers and/or WiFi access points with each new Notehub session.
768768
769769
Args:
770770
card (Notecard): The current Notecard object.
771771
minutes (int): Minimum delay, in minutes, between triangulation attempts. Use `0` for no time-based suppression.
772-
mode (str): The triangulation approach to use for determining the Notecard location. The following keywords can be used separately or together in a comma-delimited list, in any order. See Using Cell Tower & Wi-Fi Triangulation for more information.
772+
mode (str): The triangulation approach to use for determining the Notecard location. The following keywords can be used separately or together in a comma-delimited list, in any order. See Using Cell Tower & WiFi Triangulation for more information.
773773
on (bool): `true` to instruct the Notecard to triangulate even if the module has not moved. Only takes effect when `set` is `true`.
774774
set (bool): `true` to instruct the module to use the state of the `on` and `usb` arguments.
775-
text (str): When using Wi-Fi triangulation, a newline-terminated list of Wi-Fi access points obtained by the external module. Format should follow the ESP32's AT+CWLAP command output.
776-
time (int): When passed with `text`, records the time that the Wi-Fi access point scan was performed. If not provided, Notecard time is used.
775+
text (str): When using WiFi triangulation, a newline-terminated list of WiFi access points obtained by the external module. Format should follow the ESP32's AT+CWLAP command output.
776+
time (int): When passed with `text`, records the time that the WiFi access point scan was performed. If not provided, Notecard time is used.
777777
usb (bool): `true` to use perform triangulation only when the Notecard is connected to USB power. Only takes effect when `set` is `true`.
778778
779779
Returns:
@@ -799,7 +799,7 @@ def triangulate(card, minutes=None, mode=None, on=None, set=None, text=None, tim
799799

800800
@validate_card_object
801801
def usageGet(card, mode=None, offset=None):
802-
"""Return the Notecard's network usage statistics for cellular and Wi-Fi transmissions.
802+
"""Return the Notecard's network usage statistics for cellular and WiFi transmissions.
803803
804804
Args:
805805
card (Notecard): The current Notecard object.
@@ -967,14 +967,14 @@ def wireless(card, apn=None, hours=None, method=None, mode=None):
967967

968968
@validate_card_object
969969
def wifi(card, name=None, org=None, password=None, ssid=None, start=None, text=None):
970-
r"""Set up a Notecard WiFi to connect to a Wi-Fi access point.
970+
r"""Set up a Notecard WiFi to connect to a WiFi access point.
971971
972972
Args:
973973
card (Notecard): The current Notecard object.
974974
name (str): By default, the Notecard creates a SoftAP (software enabled access point) under the name "Notecard". You can use the `name` argument to change the name of the SoftAP to a custom name. If you include a `-` at the end of the `name` (for example `"name": "acme-"`), the Notecard will append the last four digits of the network's MAC address (for example `acme-025c`). This allows you to distinguish between multiple Notecards in SoftAP mode.
975975
org (str): If specified, replaces the Blues logo on the SoftAP page with the provided name.
976-
password (str): The network password of the Wi-Fi access point. Alternatively, use `-` to clear an already set password or to connect to an open access point.
977-
ssid (str): The SSID of the Wi-Fi access point. Alternatively, use `-` to clear an already set SSID.
976+
password (str): The network password of the WiFi access point. Alternatively, use `-` to clear an already set password or to connect to an open access point.
977+
ssid (str): The SSID of the WiFi access point. Alternatively, use `-` to clear an already set SSID.
978978
start (bool): Specify `true` to activate SoftAP mode on the Notecard programmatically.
979979
text (str): A string containing an array of access points the Notecard should attempt to use. The access points should be provided in the following format: `["FIRST-SSID","FIRST-PASSWORD"],["SECOND-SSID","SECOND-PASSWORD"]`. You may need to escape any quotes used in this argument before passing it to the Notecard. For example, the following is a valid request to pass to a Notecard through the In-Browser Terminal. `{"req":"card.wifi", "text":"[\"FIRST-SSID\",\"FIRST-PASSWORD\"]"}`
980980

notecard/note.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def template(card, file, body=None, delete=None, format=None, length=None, port=
159159
Args:
160160
card (Notecard): The current Notecard object.
161161
body (dict): A sample JSON body that specifies field names and values as "hints" for the data type. Possible data types are: boolean, integer, float, and string. See Understanding Template Data Types for an explanation of type hints and explanations.
162-
delete (bool): Set to `true` to delete all pending Notes using the template if one of the following scenarios is also true: Connecting via non-NTN (e.g. cellular or Wi-Fi) communications, but attempting to sync NTN-compatible Notefiles. or Connecting via NTN (e.g. satellite) communications, but attempting to sync non-NTN-compatible Notefiles. Read more about this feature in Starnote Best Practices.
162+
delete (bool): Set to `true` to delete all pending Notes using the template if one of the following scenarios is also true: Connecting via non-NTN (e.g. cellular or WiFi) communications, but attempting to sync NTN-compatible Notefiles. or Connecting via NTN (e.g. satellite) communications, but attempting to sync non-NTN-compatible Notefiles. Read more about this feature in Starnote Best Practices.
163163
file (str): The name of the Notefile to which the template will be applied.
164164
format (str): By default all Note templates automatically include metadata, including a timestamp for when the Note was created, various fields about a device's location, as well as a timestamp for when the device's location was determined. By providing a `format` of `"compact"` you tell the Notecard to omit this additional metadata to save on storage and bandwidth. The use of `format: "compact"` is required for Notecard LoRa and a Notecard paired with Starnote. When using `"compact"` templates, you may include the following keywords in your template to add in fields that would otherwise be omitted: `lat`, `lon`, `ltime`, `time`. See Creating Compact Templates to learn more.
165165
length (int): The maximum length of a `payload` (in bytes) that can be sent in Notes for the template Notefile. As of v3.2.1 `length` is not required, and payloads can be added to any template-based Note without specifying the payload length.

notecard/ntn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def gps(card, off=None, on=None):
3434

3535
@validate_card_object
3636
def reset(card):
37-
"""Once a Notecard is connected to a Starnote device, the presence of a physical Starnote is stored in a permanent configuration that is not affected by a `card.restore` request. This request clears this configuration and allows you to return to testing NTN mode over cellular or Wi-Fi.
37+
"""Once a Notecard is connected to a Starnote device, the presence of a physical Starnote is stored in a permanent configuration that is not affected by a `card.restore` request. This request clears this configuration and allows you to return to testing NTN mode over cellular or WiFi.
3838
3939
Args:
4040
card (Notecard): The current Notecard object.

0 commit comments

Comments
 (0)