@@ -654,11 +654,11 @@ def image_converter_url(image_url, width, height, color_depth=16):
654
654
width , height ,
655
655
color_depth , image_url )
656
656
657
- def io_push (self , feed , data ):
657
+ def io_push (self , feed_key , data ):
658
658
# pylint: disable=line-too-long
659
659
"""Push data to an adafruit.io feed
660
660
661
- :param str feed : Name of feed to push data to.
661
+ :param str feed_key : Name of feed to push data to.
662
662
:param data: data to send to feed
663
663
664
664
"""
@@ -668,25 +668,25 @@ def io_push(self, feed, data):
668
668
aio_username = secrets ['aio_username' ]
669
669
aio_key = secrets ['aio_key' ]
670
670
except KeyError :
671
- raise KeyError ("\n \n " )
671
+ raise KeyError ("Adafruit IO secrets are kept in secrets.py, please add them there! \n \n " )
672
672
673
673
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 )
675
675
676
676
while True :
677
677
try :
678
- feed_id = io_connect .get_feed (feed )
678
+ feed_id = io_client .get_feed (feed_key )
679
679
except AdafruitIO_RequestError :
680
680
# 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 )
682
682
except RuntimeError as exception :
683
683
print ("An error occured, retrying! 1 -" , exception )
684
684
continue
685
685
break
686
686
687
687
while True :
688
688
try :
689
- io_connect .send_data (feed_id ['key' ], data )
689
+ io_client .send_data (feed_id ['key' ], data )
690
690
except RuntimeError as exception :
691
691
print ("An error occured, retrying! 2 -" , exception )
692
692
continue
0 commit comments