From e51a8e156c2bf001ba033abce1c2bb4a5f96c004 Mon Sep 17 00:00:00 2001 From: slootsky Date: Tue, 17 Nov 2020 01:25:58 -0500 Subject: [PATCH 1/4] assume that if secrets["ssid"] is a list or a tuple, this is intentional and don't check for CHANGE ME --- adafruit_matrixportal/network.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 7384f30..448d343 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -46,7 +46,7 @@ ) raise -__version__ = "0.0.0-auto.0" +__version__ = "1.9.4" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" # pylint: disable=line-too-long @@ -295,15 +295,24 @@ def connect(self): self._wifi.neo_status(STATUS_CONNECTING) while not self._wifi.esp.is_connected: # secrets dictionary must contain 'ssid' and 'password' at a minimum - print("Connecting to AP", secrets["ssid"]) - if secrets["ssid"] == "CHANGE ME" or secrets["password"] == "CHANGE ME": - change_me = "\n" + "*" * 45 - change_me += "\nPlease update the 'secrets.py' file on your\n" - change_me += "CIRCUITPY drive to include your local WiFi\n" - change_me += "access point SSID name in 'ssid' and SSID\n" - change_me += "password in 'password'. Then save to reload!\n" - change_me += "*" * 45 - raise OSError(change_me) + if "ssid" in secrets: + if isinstance(secrets["ssid"], (list, tuple)): + print( + 'secrets["ssid"] is a list or a tuple. I assume you know what you\'re doing' + ) + else: + print("Connecting to AP", secrets["ssid"]) + if ( + secrets["ssid"] == "CHANGE ME" + or secrets["password"] == "CHANGE ME" + ): + change_me = "\n" + "*" * 45 + change_me += "\nPlease update the 'secrets.py' file on your\n" + change_me += "CIRCUITPY drive to include your local WiFi\n" + change_me += "access point SSID name in 'ssid' and SSID\n" + change_me += "password in 'password'. Then save to reload!\n" + change_me += "*" * 45 + raise OSError(change_me) self._wifi.neo_status(STATUS_NO_CONNECTION) # red = not connected try: self._wifi.esp.connect(secrets) From f3ff58aceba5b65e0aa6caaf9899f5f0865e36c3 Mon Sep 17 00:00:00 2001 From: slootsky Date: Sun, 29 Nov 2020 17:01:06 -0500 Subject: [PATCH 2/4] return index of created checkbox --- adafruit_matrixportal/matrixportal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index 8d357f7..c985f69 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -201,7 +201,7 @@ def add_text( if scrolling and self._scrolling_index is None: # Not initialized yet self._scrolling_index = self._get_next_scrollable_text_index() - + return len(self._text)-1 # pylint: enable=too-many-arguments @staticmethod From 57521f45c180b6194bd7e77d092f152684aa6b7c Mon Sep 17 00:00:00 2001 From: slootsky Date: Tue, 1 Dec 2020 21:30:12 -0500 Subject: [PATCH 3/4] ran black --- adafruit_matrixportal/matrixportal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index c985f69..0b86d99 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -201,7 +201,8 @@ def add_text( if scrolling and self._scrolling_index is None: # Not initialized yet self._scrolling_index = self._get_next_scrollable_text_index() - return len(self._text)-1 + return len(self._text) - 1 + # pylint: enable=too-many-arguments @staticmethod From 7c235ae71bbbdefd82174980ead651a3e5761232 Mon Sep 17 00:00:00 2001 From: slootsky Date: Wed, 2 Dec 2020 19:32:55 -0500 Subject: [PATCH 4/4] undo accidentally included code for array of ssid/password --- adafruit_matrixportal/network.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 448d343..7384f30 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -46,7 +46,7 @@ ) raise -__version__ = "1.9.4" +__version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" # pylint: disable=line-too-long @@ -295,24 +295,15 @@ def connect(self): self._wifi.neo_status(STATUS_CONNECTING) while not self._wifi.esp.is_connected: # secrets dictionary must contain 'ssid' and 'password' at a minimum - if "ssid" in secrets: - if isinstance(secrets["ssid"], (list, tuple)): - print( - 'secrets["ssid"] is a list or a tuple. I assume you know what you\'re doing' - ) - else: - print("Connecting to AP", secrets["ssid"]) - if ( - secrets["ssid"] == "CHANGE ME" - or secrets["password"] == "CHANGE ME" - ): - change_me = "\n" + "*" * 45 - change_me += "\nPlease update the 'secrets.py' file on your\n" - change_me += "CIRCUITPY drive to include your local WiFi\n" - change_me += "access point SSID name in 'ssid' and SSID\n" - change_me += "password in 'password'. Then save to reload!\n" - change_me += "*" * 45 - raise OSError(change_me) + print("Connecting to AP", secrets["ssid"]) + if secrets["ssid"] == "CHANGE ME" or secrets["password"] == "CHANGE ME": + change_me = "\n" + "*" * 45 + change_me += "\nPlease update the 'secrets.py' file on your\n" + change_me += "CIRCUITPY drive to include your local WiFi\n" + change_me += "access point SSID name in 'ssid' and SSID\n" + change_me += "password in 'password'. Then save to reload!\n" + change_me += "*" * 45 + raise OSError(change_me) self._wifi.neo_status(STATUS_NO_CONNECTION) # red = not connected try: self._wifi.esp.connect(secrets)