pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
196 stars 167 forks source link

pycom.nvs_get() does not return None if non-existant key #306

Open philwilkinson40 opened 5 years ago

philwilkinson40 commented 5 years ago

LoPy4 On the latest firmware Pycom MicroPython 1.18.2.r7 [v1.8.6-849-df9f237] on 2019-05-14; LoPy4 with ESP32

>>> import pycom
>>> pycom.nvs_get('anything')==None
ValueError: No matching object for the provided key

so I used a previous version of the firmware Pycom MicroPython 1.18.2.r2 [v1.8.6-849-5cf02dc] on 2019-03-07; LoPy4 with ESP32

>>>import pycom
>>>pycom.nvs_get('anything')==None
True
>>>

docs state If a non-existing key is given the returned value will be None.

iwahdan88 commented 5 years ago

@philwilkinson40 yes, I confirm there is a discrepancy between the doc and the output of that API which was updated last release to support saving strings in NVS... This FW will be updated in next release