From b71ee1a609ccf29f87554c4aedbf40b266324345 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 5 Mar 2021 08:01:44 -0800 Subject: [PATCH] Fix graphics and network when inited directly with no params --- adafruit_matrixportal/graphics.py | 8 ++++++-- adafruit_matrixportal/network.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/adafruit_matrixportal/graphics.py b/adafruit_matrixportal/graphics.py index 80be3c1..950dfb4 100755 --- a/adafruit_matrixportal/graphics.py +++ b/adafruit_matrixportal/graphics.py @@ -57,8 +57,12 @@ def __init__( self, **kwargs, ): - default_bg = kwargs.pop("default_bg") - debug = kwargs.pop("debug") + default_bg = 0x000000 + debug = False + if "default_bg" in kwargs: + default_bg = kwargs.pop("default_bg") + if "debug" in kwargs: + debug = kwargs.pop("debug") matrix = Matrix(**kwargs) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 8b69ac6..8d7b953 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -50,9 +50,11 @@ class Network(NetworkBase): def __init__(self, **kwargs): extract_values = True + debug = False if "extract_values" in kwargs: extract_values = kwargs.pop("extract_values") - debug = kwargs.pop("debug") + if "debug" in kwargs: + debug = kwargs.pop("debug") wifi = WiFi(**kwargs) super().__init__(