Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notecard/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def restore(card, connected=None, delete=None):

Args:
card (Notecard): The current Notecard object.
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.
connected (bool): Set to `true` to also reset the device's record on Notehub. The next time the Notecard connects to Notehub with the same `ProductUID` it had when this request was sent, Notehub deletes the device's environment variables, Notefiles, Notefile templates, and fleet memberships, and the device continues in the project as if newly added. This does not remove the device from the project, its events are kept, and it can lift a block placed on the device in Notehub.
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.

Returns:
Expand Down
6 changes: 3 additions & 3 deletions notecard/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def set(card, align=None, details=None, duration=None, host=None, inbound=None,
details (str): When using Notecard for LoRa you can use this argument to provide information about an alternative LoRaWAN server or service you would like the Notecard to use. The argument you provide must be a JSON object with three keys, "deveui", "appeui", and "appkey", all of which are hexadecimal strings with no leading 0x. For example: `{"deveui":"0080E11500088B37","appeui":"6E6F746563617264","appkey":"00088B37"}` The LoRaWAN details you send to a Notecard become part of its permanent configuration, and survive factory resets. You can reset a Notecard's LoRaWAN details to its default values by providing a `"-"` for the details argument.
duration (int): When in `continuous` mode, the amount of time, in minutes, of each session (the minimum allowed value is `15`). When this time elapses, the Notecard gracefully ends the current session and starts a new one in order to sync session-specific data to Notehub.
host (str): The URL of the Notehub service. Use `"-"` to reset to the default value.
inbound (int): The max wait time, in minutes, to sync inbound data from Notehub. Explicit syncs (e.g. using `hub.sync`) do not affect this cadence. When in `periodic` or `continuous` mode this argument is required, otherwise the Notecard will function as if it is in `minimum` mode as it pertains to syncing behavior. Use `-1` to reset the value back to its default of `0`. A value of `0` means that the Notecard will never sync inbound data unless explicitly told to do so (e.g. using `hub.sync`).
inbound (int): The maximum wait time, in minutes, before syncing inbound data from Notehub. The default value of `0` disables automatic inbound syncing, meaning inbound data is only synced when explicitly requested, such as with `hub.sync`. Because of this, the `inbound` argument is required in `periodic` and `continuous` modes. Set to `-1` to restore the default value. The `_sync_inbound_mins` reserved environment variable and its variants override this setting when defined.
mode (str): The Notecard's synchronization mode. NOTE: The Notecard must be in `periodic` or `continuous` mode to use the onboard GPS module.
off (bool): Set to `true` to manually instruct the Notecard to resume periodic mode after a web transaction has completed.
on (bool): If in `periodic` mode, used to temporarily switch the Notecard to `continuous` mode to perform a web transaction. Ignored if the Notecard is already in `continuous` mode or if the Notecard is NOT performing a web transaction.
outbound (int): The max wait time, in minutes, to sync outbound data from the Notecard. Explicit syncs (e.g. using `hub.sync`) do not affect this cadence. When in `periodic` or `continuous` mode this argument is required, otherwise the Notecard will function as if it is in `minimum` mode as it pertains to syncing behavior. Use `-1` to reset the value back to its default of `0`. A value of `0` means that the Notecard will never sync outbound data unless explicitly told to do so (e.g. using `hub.sync`).
outbound (int): The maximum wait time, in minutes, before syncing outbound data from the Notecard. The default value of `0` disables automatic outbound syncing, meaning outbound data is only synced when explicitly requested, such as with `hub.sync`. Because of this, the `outbound` argument is required in `periodic` and `continuous` modes. Set to `-1` to restore the default value. The `_sync_outbound_mins` reserved environment variable and its variants override this setting when defined.
product (str): A Notehub-managed unique identifier that is used to match Devices with Projects. This string is used during a device's auto-provisioning to find the Notehub Project that, once provisioned, will securely manage the device and its data.
seconds (int): If in `periodic` mode and using `on` above, the number of seconds to run in continuous mode before switching back to periodic mode. If not set, a default of 300 seconds is used. Ignored if the Notecard is already in continuous mode.
sn (str): The end product's serial number.
Expand Down Expand Up @@ -158,7 +158,7 @@ def sync(card, allow=None, in_=None, out_=None):
Args:
card (Notecard): The current Notecard object.
allow (bool): Set to `true` to remove the Notecard from certain types of penalty boxes (the default is `false`).
in_ (bool): Set to `true` to only sync pending inbound Notefiles. Required when using NTN mode with Starnote to check for inbound Notefiles.
in_ (bool): Set to `true` to check Notehub for inbound Notefiles and environment variables. Required in NTN mode, where a `hub.sync` without this argument only sends outbound data. Over cellular and WiFi, a `hub.sync` already checks for inbound data, so this argument has no additional effect.
out_ (bool): Set to `true` to only sync pending outbound Notefiles.

Returns:
Expand Down