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

Corrections to receive_n_data documentation #113

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Next Next commit
corrections to receive_n_data documentation
receive_n_data
- added missing n_values :param
- changed description for more accurate wording

validate_n_values
- changed description for better formatting in docs
  • Loading branch information
kavinaidoo committed Dec 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 32d97e41d9b9ee469f909a6a3e1dee480f77da7c
6 changes: 3 additions & 3 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
@@ -58,8 +58,7 @@ def validate_n_values(n_values: int):
"""Validates a provided number of values to retrieve data from Adafruit IO.

Although Adafruit IO will accept values < 1 and > 1000, this avoids two types of issues:
<1 - Coding errors
>1000 - Pagination-related expectation management
n_values < 1 (coding errors) and n_values > 1000 (pagination required for HTTP API)

"""
if n_values < 1 or n_values > 1000: # validate 0 < n_values <= 1000
@@ -649,10 +648,11 @@ def receive_all_data(self, feed_key: str):

def receive_n_data(self, feed_key: str, n_values: int):
"""
Get n data values from a specified Adafruit IO feed. Data is
Get most recent n data values from a specified feed. Data is
returned in reverse order.

:param str feed_key: Adafruit IO feed key
:param int n_values: Number of data values
"""
validate_n_values(n_values)
validate_feed_key(feed_key)