Skip to content

Commit 02b42cc

Browse files
committed
Merge in additional changes from weekend
2 parents 76ce579 + c298bc3 commit 02b42cc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

adafruit_magtag/graphics.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,21 @@ class Graphics(GraphicsBase):
4040
"""Graphics Helper Class for the MagTag Library
4141
4242
:param default_bg: The path to your default background image file or a hex color.
43-
Defaults to 0x000000.
43+
Defaults to 0xFFFFFF.
4444
:param bool auto_refresh: Automatically refresh the eInk after writing to displayio.
4545
Defaults to True.
46+
:param rotation: Default rotation is landscape (270) but can be 0, 90, 180 for portrait/rotated
4647
:param debug: Turn on debug print outs. Defaults to False.
4748
4849
"""
4950

5051
# pylint: disable=too-many-instance-attributes, too-many-locals, too-many-branches, too-many-statements
51-
def __init__(self, *, default_bg=0xFFFFFF, auto_refresh=True, debug=False):
52+
def __init__(
53+
self, *, default_bg=0xFFFFFF, auto_refresh=True, rotation=270, debug=False
54+
):
55+
self._debug = debug
56+
self.display = board.DISPLAY
57+
self.display.rotation = rotation
5258
self.auto_refresh = auto_refresh
5359
self._qr_group = None
5460

adafruit_magtag/magtag.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class MagTag(PortalBase):
5454
on-board NeoPixel. Defaults to ``None``, to not use the status LED
5555
:param json_transform: A function or a list of functions to call with the parsed JSON.
5656
Changes and additions are permitted for the ``dict`` object.
57+
:param rotation: Default rotation is landscape (270) but can be 0, 90, or 180 for
58+
portrait/rotated
5759
:param debug: Turn on debug print outs. Defaults to False.
5860
5961
"""
@@ -69,6 +71,7 @@ def __init__(
6971
default_bg=0xFFFFFF,
7072
status_neopixel=None,
7173
json_transform=None,
74+
rotation=270,
7275
debug=False,
7376
):
7477

@@ -81,6 +84,7 @@ def __init__(
8184
graphics = Graphics(
8285
default_bg=default_bg,
8386
auto_refresh=False,
87+
rotation=rotation,
8488
debug=debug,
8589
)
8690

0 commit comments

Comments
 (0)