From 3cd3c6e596b41b48a3daacb3f625156525ddebf1 Mon Sep 17 00:00:00 2001 From: Cooper Dalrymple Date: Tue, 12 Aug 2025 14:08:31 -0500 Subject: [PATCH] Fix formatting --- adafruit_fruitjam/peripherals.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/adafruit_fruitjam/peripherals.py b/adafruit_fruitjam/peripherals.py index f49e65b..8c77735 100644 --- a/adafruit_fruitjam/peripherals.py +++ b/adafruit_fruitjam/peripherals.py @@ -75,14 +75,13 @@ def request_display_config(width=None, height=None, color_depth=None): # if user does not specify width, use default configuration if width is None and (width := os.getenv("CIRCUITPY_DISPLAY_WIDTH")) is None: raise ValueError("No CIRCUITPY_DISPLAY_WIDTH specified in settings.toml.") - + # check that we have a valid display size - if ( - (height is not None and (width, height) not in VALID_DISPLAY_SIZES) or - (height is None and width not in [size[0] for size in VALID_DISPLAY_SIZES]) + if (height is not None and (width, height) not in VALID_DISPLAY_SIZES) or ( + height is None and width not in [size[0] for size in VALID_DISPLAY_SIZES] ): raise ValueError(f"Invalid display size. Must be one of: {VALID_DISPLAY_SIZES}") - + # if user does not specify height, use matching height if height is None: height = next((h for w, h in VALID_DISPLAY_SIZES if width == w))