Merge pull request #3 from adafruit/TheKitty-patch-1

Update peripherals.py to include a new get_display_config function
This commit is contained in:
foamyguy 2025-07-09 14:05:26 -05:00 committed by GitHub
commit 8d3f1ab83a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,6 +80,23 @@ def request_display_config(width, height):
supervisor.runtime.display = framebufferio.FramebufferDisplay(fb)
def get_display_config():
"""
Get the current display size configuration.
:return: width: The width of the display in pixels.
:return: height: The height of the display in pixels.
:return: pixel_depth of the display in pixels
"""
try:
display = supervisor.runtime.display
display_config = (display.width, display.height, display.framebuffer.color_depth)
return display_config
except ValueError:
return (None, None, None)
class Peripherals:
"""Peripherals Helper Class for the FruitJam Library