Skip to content

Commit

Permalink
corrections to receive_n_data documentation
Browse files Browse the repository at this point in the history
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
1 parent af3c50e commit 9ce9490
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def validate_feed_key(feed_key: str):
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
Although Adafruit IO will accept values < 1 and > 1000, this avoids two types of issues: n_values < 1 (coding errors) and n_values > 1000 (pagination required)

Check failure on line 60 in adafruit_io/adafruit_io.py

View workflow job for this annotation

GitHub Actions / test

Line too long (163/100)
"""
if n_values < 1 or n_values > 1000: # validate 0 < n_values <= 1000
Expand Down Expand Up @@ -649,10 +647,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)
Expand Down

0 comments on commit 9ce9490

Please sign in to comment.