Skip to content

Commit

Permalink
Fix Calendar and Weather for Inky SSD1608
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Oct 30, 2020
1 parent 10862b3 commit f5b5bb5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
10 changes: 7 additions & 3 deletions examples/phat/calendar-phat.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
colour = args.colour

# Set up the display
if colour == "auto":
try:
from inky.auto import auto
inky_display = auto()
colour = inky_display.colour
else:
inky_display = InkyPHAT(colour)
print("Auto-detected {} Inky pHAT".format(colour))
except RuntimeError:
if colour == "auto":
raise RuntimeError("Failed to auto-detect your Inky pHAT, try specifying a colour manually.")
else:
inky_display = InkyPHAT(colour)

inky_display.set_border(inky_display.BLACK)

Expand Down
13 changes: 8 additions & 5 deletions examples/phat/weather-phat.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@
args = parser.parse_args()

# Set up the display

colour = args.colour
if colour == "auto":
try:
from inky.auto import auto
inky_display = auto()
colour = inky_display.colour
else:
inky_display = InkyPHAT(colour)
print("Auto-detected {} Inky pHAT".format(colour))
except RuntimeError:
if colour == "auto":
raise RuntimeError("Failed to auto-detect your Inky pHAT, try specifying a colour manually.")
else:
inky_display = InkyPHAT(colour)

inky_display.set_border(inky_display.BLACK)

# Details to customise your weather display
Expand Down

0 comments on commit f5b5bb5

Please sign in to comment.