Skip to content

Commit 963691d

Browse files
committed
fix: updates to latest schema
1 parent d692d9c commit 963691d

File tree

7 files changed

+406
-406
lines changed

7 files changed

+406
-406
lines changed

notecard/card.py

Lines changed: 206 additions & 206 deletions
Large diffs are not rendered by default.

notecard/dfu.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,38 @@ def get(card, length=None, offset=None):
3333

3434

3535
@validate_card_object
36-
def status(card, name=None, stop=None, status=None, version=None, vvalue=None, on=None, off=None, err=None):
36+
def status(card, err=None, name=None, off=None, on=None, status=None, stop=None, version=None, vvalue=None):
3737
"""Get and sets the background download status of MCU host or Notecard firmware updates.
3838
3939
Args:
4040
card (Notecard): The current Notecard object.
41+
err (str): If `err` text is provided along with `"stop":true`, this sets the host DFU to an error state with the specified string.
4142
name (str): Determines which type of firmware update status to view. The value can be `"user"` (default), which gets the status of MCU host firmware updates, or `"card"`, which gets the status of Notecard firmware updates.
42-
stop (bool): `true` to clear DFU state and delete the local firmware image from the Notecard.
43+
off (bool): `true` to disable firmware downloads from Notehub.
44+
on (bool): `true` to allow firmware downloads from Notehub.
4345
status (str): When setting `stop` to `true`, an optional string synchronized to Notehub, which can be used for informational or diagnostic purposes.
46+
stop (bool): `true` to clear DFU state and delete the local firmware image from the Notecard.
4447
version (str): Version information on the host firmware to pass to Notehub. You may pass a simple version number string (e.g. `"1.0.0.0"`), or an object with detailed information about the firmware image (recommended). If you provide an object it must take the following form. `{"org":"my-organization","product":"My Product","description":"A description of the image","version":"1.2.4","built":"Jan 01 2025 01:02:03","vermajor":1,"verminor":2,"verpatch":4,"verbuild": 5,"builder":"The Builder"}` Code to help you generate a version with the correct formatting is available in Enabling Notecard Outboard Firmware Update.
4548
vvalue (str): A voltage-variable string that controls, by Notecard voltage, whether or not DFU is enabled. Use a boolean `1` (on) or `0` (off) for each source/voltage level: `usb:<1/0>;high:<1/0>;normal:<1/0>;low:<1/0>;dead:0`.
46-
on (bool): `true` to allow firmware downloads from Notehub.
47-
off (bool): `true` to disable firmware downloads from Notehub.
48-
err (str): If `err` text is provided along with `"stop":true`, this sets the host DFU to an error state with the specified string.
4949
5050
Returns:
5151
dict: The result of the Notecard request.
5252
"""
5353
req = {"req": "dfu.status"}
54+
if err:
55+
req["err"] = err
5456
if name:
5557
req["name"] = name
56-
if stop is not None:
57-
req["stop"] = stop
58+
if off is not None:
59+
req["off"] = off
60+
if on is not None:
61+
req["on"] = on
5862
if status:
5963
req["status"] = status
64+
if stop is not None:
65+
req["stop"] = stop
6066
if version:
6167
req["version"] = version
6268
if vvalue:
6369
req["vvalue"] = vvalue
64-
if on is not None:
65-
req["on"] = on
66-
if off is not None:
67-
req["off"] = off
68-
if err:
69-
req["err"] = err
7070
return card.Transaction(req)

notecard/hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def set(card, align=None, details=None, duration=None, host=None, inbound=None,
122122

123123
@validate_card_object
124124
def signal(card, seconds=None):
125-
"""Receive a Signal (a near-real-time note) from Notehub. This request checks for an inbound signal from Notehub. If it finds a signal, this request returns the signal's body and deletes the signal. If there are multiple signals to receive, this request reads and deletes signals in FIFO (first in first out) order.
125+
"""Receive a Signal (a near-real-time Note) from Notehub. This request checks for an inbound signal from Notehub. If it finds a signal, this request returns the signal's body and deletes the signal. If there are multiple signals to receive, this request reads and deletes signals in FIFO (first in first out) order.
126126
127127
Args:
128128
card (Notecard): The current Notecard object.

0 commit comments

Comments
 (0)