Skip to content

you spin me right round baby right round #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions adafruit_magtag/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ class Graphics:
Defaults to 0x000000.
:param bool auto_refresh: Automatically refresh the eInk after writing to displayio.
Defaults to True.
:param rotation: Default rotation is landscape (270) but can be 0, 90, 180 for portrait/rotated
:param debug: Turn on debug print outs. Defaults to False.

"""

# pylint: disable=too-many-instance-attributes, too-many-locals, too-many-branches, too-many-statements
def __init__(self, *, default_bg=0xFFFFFF, auto_refresh=True, debug=False):
def __init__(
self, *, default_bg=0xFFFFFF, auto_refresh=True, rotation=270, debug=False
):

self._debug = debug
if not hasattr(board, "DISPLAY"):
Expand All @@ -65,7 +68,7 @@ def __init__(self, *, default_bg=0xFFFFFF, auto_refresh=True, debug=False):
display_bus,
width=296,
height=128,
rotation=270,
rotation=rotation,
black_bits_inverted=False,
color_bits_inverted=False,
grayscale=True,
Expand All @@ -74,6 +77,7 @@ def __init__(self, *, default_bg=0xFFFFFF, auto_refresh=True, debug=False):
)
else:
self.display = board.DISPLAY
self.display.rotation = rotation

self.auto_refresh = auto_refresh

Expand Down
4 changes: 4 additions & 0 deletions adafruit_magtag/magtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class MagTag:
NeoPixel. Defaults to ``None``, not the status LED
:param json_transform: A function or a list of functions to call with the parsed JSON.
Changes and additions are permitted for the ``dict`` object.
:param rotation: Default rotation is landscape (270) but can be 0, 90, or 180 for
portrait/rotated
:param debug: Turn on debug print outs. Defaults to False.

"""
Expand All @@ -69,13 +71,15 @@ def __init__(
default_bg=0xFFFFFF,
status_neopixel=None,
json_transform=None,
rotation=270,
debug=False,
):

self._debug = debug
self.graphics = Graphics(
default_bg=default_bg,
auto_refresh=False,
rotation=rotation,
debug=debug,
)
self.display = self.graphics.display
Expand Down