Skip to content

Commit bce045f

Browse files
Update Notecard API from upstream schema changes (9ab58a6624353a7974805f64a14b8672f3f727c5) (#164)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b907ba2 commit bce045f

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

notecard/card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def temp(card, minutes=None, status=None, stop=None, sync=None):
707707

708708
@validate_card_object
709709
def time(card):
710-
"""Retrieve current date and time information in UTC. Upon power-up, the Notecard must complete a sync to Notehub in order to obtain time and location data. Before the time is obtained, this request will return `{"zone":"UTC,Unknown"}`.
710+
"""Retrieve current date and time information in UTC. Upon power-up, the Notecard must complete a sync to Notehub in order to obtain time and location data. Before the time is obtained, this request will return `{"zone":"UTC,Unknown"}`. The Notecard's stored timezone is only updated when a new Notehub session begins.
711711
712712
Args:
713713
card (Notecard): The current Notecard object.

notecard/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
@validate_card_object
16-
def default(card, name=None, sync=None, text=None):
16+
def default(card, name, sync=None, text=None):
1717
"""Use by the Notecard host to specify a default value for an environment variable until that variable is overridden by a device, project or fleet-wide setting at Notehub.
1818
1919
Args:
@@ -76,7 +76,7 @@ def modified(card, time=None):
7676

7777

7878
@validate_card_object
79-
def set(card, name=None, text=None):
79+
def set(card, name, text=None):
8080
"""Set a local environment variable on the Notecard. Local environment variables cannot be overridden by a Notehub variable of any scope.
8181
8282
Args:

notecard/web.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def delete(card, async_=None, content=None, file=None, name=None, note=None, rou
1818
1919
Args:
2020
card (Notecard): The current Notecard object.
21-
async_ (bool): If `true`, the Notecard performs the web request asynchronously, and returns control to the host without waiting for a response from Notehub.
21+
async_ (bool): If `true`, the Notecard performs the web request asynchronously, and returns control to the host without waiting for a response from Notehub. This argument only applies when the Notecard is in `continuous` mode and currently online.
2222
content (str): The MIME type of the body or payload of the response. Default is `application/json`.
23-
file (str): The name of the local-only Database Notefile (`.dbx`) to be used if the web request is issued asynchronously and you wish to store the response.
23+
file (str): The name of a local-only Database Notefile (.dbx) where the response will be stored when the web request is executed as a queued web transaction (e.g. if the request is made when Notecard is not in continuous mode and not online). If `file` is not specified, queued web transaction responses are discarded. This argument is not used when the Notecard is in `continuous` mode and online, as responses in that case are returned directly to the host.
2424
name (str): A web URL endpoint relative to the host configured in the Proxy Route. URL parameters may be added to this argument as well (e.g. `/deleteReading?id=1`).
25-
note (str): The unique Note ID for the local-only Database Notefile (`.dbx`). Only used with asynchronous web requests (see `file` argument above).
25+
note (str): The unique Note ID within the local-only Database Notefile (.dbx) specified by the `file` argument (see above). Used with queued web transactions to identify a specific Note where the response will be stored.
2626
route (str): Alias for a Proxy Route in Notehub.
2727
seconds (int): If specified, overrides the default 90 second timeout.
2828
@@ -110,7 +110,7 @@ def post(card, async_=None, binary=None, body=None, content=None, file=None, max
110110
route (str): Alias for a Proxy Route in Notehub.
111111
seconds (int): If specified, overrides the default 90 second timeout.
112112
status (str): A 32-character hex-encoded MD5 sum of the payload or payload fragment. Used by Notehub to perform verification upon receipt.
113-
total (int): When using the `application/octet-stream` content type, you may send large payloads to Notehub in fragments spanning several `web.post` requests by using `offset` (see above) and `total`. The `total` field indicates the total size, in bytes (10MB max), of the payload across all fragments.
113+
total (int): When using the `application/octet-stream` content type, you may send large payloads to Notehub in fragments spanning several `web.post` requests by using `offset` (see above) and `total`. The `total` field indicates the total size, in bytes, of the payload across all fragments.
114114
verify (bool): `true` to request verification from Notehub once the payload or payload fragment is received. Automatically set to `true` when `status` is supplied.
115115
116116
Returns:
@@ -169,7 +169,7 @@ def put(card, async_=None, binary=None, body=None, content=None, file=None, max=
169169
route (str): Alias for a Proxy Route in Notehub.
170170
seconds (int): If specified, overrides the default 90 second timeout.
171171
status (str): A 32-character hex-encoded MD5 sum of the payload or payload fragment. Used by Notehub to perform verification upon receipt.
172-
total (int): When using the `application/octet-stream` content type, you may send large payloads to Notehub in fragments spanning several `web.put` requests by using `offset` (see above) and `total`. The `total` field indicates the total size, in bytes (10MB max), of the payload across all fragments.
172+
total (int): When using the `application/octet-stream` content type, you may send large payloads to Notehub in fragments spanning several `web.put` requests by using `offset` (see above) and `total`. The `total` field indicates the total size, in bytes, of the payload across all fragments.
173173
verify (bool): `true` to request verification from Notehub once the payload or payload fragment is received. Automatically set to `true` when `status` is supplied.
174174
175175
Returns:

0 commit comments

Comments
 (0)