1616from luma .core .legacy import text , show_message
1717from luma .core .legacy .font import proportional , CP437_FONT , TINY_FONT , SINCLAIR_FONT , LCD_FONT
1818from backports .datetime_fromisoformat import MonkeyPatch
19+ from pathlib import Path
1920
2021MonkeyPatch .patch_fromisoformat ()
2122# If modifying these scopes, delete the file token.pickle.
@@ -62,6 +63,11 @@ def main(argv):
6263 """Shows basic usage of the Google Calendar API.
6364 Prints the start and name of the next 10 events on the user's calendar.
6465 """
66+
67+ # Get version
68+ version = Path ('version.txt' ).read_text ().replace ('\n ' ,'' )
69+ print ("Version: " , version )
70+
6571 creds = None
6672 # The file token.pickle stores the user's access and refresh tokens, and is
6773 # created automatically when the authorization flow completes for the first
@@ -87,7 +93,11 @@ def main(argv):
8793 serial = spi (port = 0 , device = 0 , gpio = noop ())
8894 device = max7219 (serial , cascaded = 8 , block_orientation = 90 , rotate = 0 )
8995 print ("Created device" )
90-
96+
97+ # Show version
98+ show_message (device , "Ver. " + version , fill = "white" , font = proportional (CP437_FONT ))
99+ time .sleep (4 )
100+
91101 start = time .perf_counter ()
92102 while (start + 550 ) > time .perf_counter () or loop :
93103 # Call the Calendar API
0 commit comments