Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update description of nvs_get #427

Open
wants to merge 1 commit into
base: publish
Choose a base branch
from
Open

Conversation

avram-pycom
Copy link

No description provided.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


avram-pycom seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@gijsio gijsio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I was not aware of this functionality 👍 . Let me know what you think of my suggestions.

Gijs


If a non-existing key is given the returned value will be `None`.
If a non-existing key is given the returned value will be the optional_default_value if it is provided, else an error will be raised. The error message for missing key is: "No matching object for the provided key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we mention the error type (ValueError) instead of the error text?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please hold.
It seems there are more info to add. I have other priorities at the moment but I will be back with changes.

@@ -33,11 +33,11 @@ Get or set the colour of the RGB LED. The colour is specified as 24 bit value re

Set the value of the specified key in the NVRAM memory area of the external flash. Data stored here is preserved across resets and power cycles. Value can only take 32-bit integers at the moment. Example:

### pycom.nvs_get(key)
### pycom.nvs_get(key[, optional_default_value])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The square brackets already indicate 'optional', perhaps its better to call it 'default_value'? I couldn't find how we call it in the firmware, but its always best to match that.

@peter-pycom
Copy link
Contributor

ping. who's waiting on whom here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants