3636__version__ = "0.0.0+auto.0"
3737__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PortalBase.git"
3838
39- # pylint: disable=line-too-long, too-many-lines
39+ # pylint: disable=line-too-long, too-many-lines, too-many-public-methods
4040# you'll need to pass in an io username and key
4141TIME_SERVICE = (
4242 "https://io.adafruit.com/api/v2/%s/integrations/time/strftime?x-aio-key=%s"
@@ -493,8 +493,6 @@ def get_io_feed(self, feed_key, detailed=False):
493493 except RuntimeError as exception :
494494 print ("An error occured, retrying! 1 -" , exception )
495495 continue
496- break
497- return None
498496
499497 def get_io_group (self , group_key ):
500498 """Return the Adafruit IO Group that matches the group key
@@ -510,8 +508,6 @@ def get_io_group(self, group_key):
510508 except RuntimeError as exception :
511509 print ("An error occured, retrying! 1 -" , exception )
512510 continue
513- break
514- return None
515511
516512 def get_io_data (self , feed_key ):
517513 """Return all values from Adafruit IO Feed Data that matches the feed key
@@ -527,8 +523,21 @@ def get_io_data(self, feed_key):
527523 except RuntimeError as exception :
528524 print ("An error occured, retrying! 1 -" , exception )
529525 continue
530- break
531- return None
526+
527+ def delete_io_data (self , feed_key : str , data_id : str ):
528+ """Return all values from Adafruit IO Feed Data that matches the feed key
529+
530+ :param str feed_key: Name of feed key to receive data from.
531+
532+ """
533+ io_client = self ._get_io_client ()
534+
535+ while True :
536+ try :
537+ return io_client .delete_data (feed_key , data_id )
538+ except RuntimeError as exception :
539+ print ("An error occured, retrying! 1 -" , exception )
540+ continue
532541
533542 def fetch (self , url , * , headers = None , timeout = 10 ):
534543 """Fetch data from the specified url and return a response object
@@ -740,3 +749,8 @@ def process_json(self, json_data, json_path):
740749 def is_connected (self ):
741750 """Return whether we are connected."""
742751 return self ._wifi .is_connected
752+
753+ @property
754+ def io_client (self ):
755+ """Return the Adafruit IO Client."""
756+ return self ._get_io_client ()
0 commit comments