You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Create an instance of the REST client.
aio = Client(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
try: # i we have a 'digital' feed
digital = aio.feeds('digital')
except RequestError: # create a digital feed
feed = Feed(name="digital")
digital = aio.create_feed(feed)
while True:
print(digital)
data = aio.receive(digital.key)
time.sleep(0.5)
Output
Traceback (most recent call last):
File "/home/pi/Documents/digital_out.py", line 45, in <module>
data = aio.receive(digital.key)
File "/home/pi/.local/lib/python3.7/site-packages/Adafruit_IO/client.py", line 216, in receive
return Data.from_dict(self._get(path))
File "/home/pi/.local/lib/python3.7/site-packages/Adafruit_IO/client.py", line 118, in _get
self._handle_error(response)
File "/home/pi/.local/lib/python3.7/site-packages/Adafruit_IO/client.py", line 108, in _handle_error
raise RequestError(response)
Adafruit_IO.errors.RequestError: Adafruit IO request failed: 404 Not Found - not found - API documentation can be found at https://io.adafruit.com/api/docs
The text was updated successfully, but these errors were encountered:
Not sure if this library is still maintained, but this is a core breaking bug that has been open for at least a year. Is there any plan to tackle it or will someone try and fork the library?
>>> aio.receive("myfeed") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.7/dist-packages/adafruit_io-2.5.0-py3.7.egg/Adafruit_IO/client.py", line 216, in receive File "/usr/local/lib/python3.7/dist-packages/adafruit_io-2.5.0-py3.7.egg/Adafruit_IO/client.py", line 118, in _get File "/usr/local/lib/python3.7/dist-packages/adafruit_io-2.5.0-py3.7.egg/Adafruit_IO/client.py", line 108, in _handle_error Adafruit_IO.errors.RequestError: Adafruit IO request failed: 404 Not Found - not found - API documentation can be found at https://io.adafruit.com/api/docs
Calling
client.receive
on a newly created feed with no data points raises a 404 if no data exists on the feed.Update the library to not error on that call with a 404, and instead return a
None
value or a Data type which sets thevalue
asNone
:Example code
Output
The text was updated successfully, but these errors were encountered: