Skip to content

Commit 7863e5b

Browse files
authored
Merge pull request #45 from justmobilize/remove-secrets-usage
Remove secrets usage
2 parents da9cc9f + e50eb93 commit 7863e5b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

adafruit_funhouse/network.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,12 @@ def __init__(
7373

7474
def init_io_mqtt(self) -> IO_MQTT:
7575
"""Initialize MQTT for Adafruit IO"""
76-
try:
77-
aio_username = self._get_setting("AIO_USERNAME")
78-
aio_key = self._get_setting("AIO_KEY")
79-
except KeyError:
80-
raise KeyError(
81-
"Adafruit IO secrets are kept in settings.toml, please add them there!\n\n"
82-
) from KeyError
76+
aio_username = self._get_setting["ADAFRUIT_AIO_USERNAME"]
77+
aio_key = self._get_setting["ADAFRUIT_AIO_KEY"]
78+
if None in [aio_username, aio_key]:
79+
raise AttributeError(
80+
"Adafruit IO keys are kept in settings.toml, please add them there."
81+
)
8382

8483
return self.init_mqtt(IO_MQTT_BROKER, 8883, aio_username, aio_key, True)
8584

docs/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"ssl",
3434
"wifi",
3535
"socketpool",
36-
"secrets",
3736
"analogio",
3837
"touchio",
3938
"bitmaptools",

0 commit comments

Comments
 (0)