From e50eb939e3f566b13c622cfbfb8556d089b89566 Mon Sep 17 00:00:00 2001 From: Justin Myers Date: Thu, 27 Feb 2025 15:39:44 -0800 Subject: [PATCH] Remove secrets usage --- adafruit_funhouse/network.py | 13 ++++++------- docs/conf.py | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/adafruit_funhouse/network.py b/adafruit_funhouse/network.py index a537ebf..56f662a 100755 --- a/adafruit_funhouse/network.py +++ b/adafruit_funhouse/network.py @@ -73,13 +73,12 @@ def __init__( def init_io_mqtt(self) -> IO_MQTT: """Initialize MQTT for Adafruit IO""" - try: - aio_username = self._get_setting("AIO_USERNAME") - aio_key = self._get_setting("AIO_KEY") - except KeyError: - raise KeyError( - "Adafruit IO secrets are kept in settings.toml, please add them there!\n\n" - ) from KeyError + aio_username = self._get_setting["ADAFRUIT_AIO_USERNAME"] + aio_key = self._get_setting["ADAFRUIT_AIO_KEY"] + if None in [aio_username, aio_key]: + raise AttributeError( + "Adafruit IO keys are kept in settings.toml, please add them there." + ) return self.init_mqtt(IO_MQTT_BROKER, 8883, aio_username, aio_key, True) diff --git a/docs/conf.py b/docs/conf.py index de4a500..f6c20ba 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,6 @@ "ssl", "wifi", "socketpool", - "secrets", "analogio", "touchio", "bitmaptools",