Skip to content

Commit eb23859

Browse files
committed
Style changes as requested
1 parent 569adef commit eb23859

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

adafruit_pyportal.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,11 @@ def image_converter_url(image_url, width, height, color_depth=16):
654654
width, height,
655655
color_depth, image_url)
656656

657-
def io_push(self, feed, data):
657+
def io_push(self, feed_key, data):
658658
# pylint: disable=line-too-long
659659
"""Push data to an adafruit.io feed
660660
661-
:param str feed: Name of feed to push data to.
661+
:param str feed_key: Name of feed to push data to.
662662
:param data: data to send to feed
663663
664664
"""
@@ -668,25 +668,25 @@ def io_push(self, feed, data):
668668
aio_username = secrets['aio_username']
669669
aio_key = secrets['aio_key']
670670
except KeyError:
671-
raise KeyError("\n\n")
671+
raise KeyError("Adafruit IO secrets are kept in secrets.py, please add them there!\n\n")
672672

673673
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(self._esp, secrets, None)
674-
io_connect = RESTClient(aio_username, aio_key, wifi)
674+
io_client = RESTClient(aio_username, aio_key, wifi)
675675

676676
while True:
677677
try:
678-
feed_id = io_connect.get_feed(feed)
678+
feed_id = io_client.get_feed(feed_key)
679679
except AdafruitIO_RequestError:
680680
# If no feed exists, create one
681-
feed_id = io_connect.create_new_feed(feed)
681+
feed_id = io_client.create_new_feed(feed_key)
682682
except RuntimeError as exception:
683683
print("An error occured, retrying! 1 -", exception)
684684
continue
685685
break
686686

687687
while True:
688688
try:
689-
io_connect.send_data(feed_id['key'], data)
689+
io_client.send_data(feed_id['key'], data)
690690
except RuntimeError as exception:
691691
print("An error occured, retrying! 2 -", exception)
692692
continue

0 commit comments

Comments
 (0)