@@ -74,11 +74,13 @@ def __init__(self):
7474 self .lcd = LcdSimulated (display_width = 480 ,
7575 display_height = 800 )
7676 else :
77- logger .error ("Unknown display revision '" , config .CONFIG_DATA ["display" ]["REVISION" ], "'" )
77+ logger .error ("Unknown display revision '" ,
78+ config .CONFIG_DATA ["display" ]["REVISION" ], "'" )
7879
7980 def initialize_display (self ):
8081 # Reset screen in case it was in an unstable state (screen is also cleared)
81- self .lcd .Reset ()
82+ if config .CONFIG_DATA ["display" ]["WORKAROUND_RESET" ] != "Y" :
83+ self .lcd .Reset ()
8284
8385 # Send initialization commands
8486 self .lcd .InitializeComm ()
@@ -97,7 +99,8 @@ def turn_on(self):
9799 self .lcd .SetBrightness (config .CONFIG_DATA ["display" ]["BRIGHTNESS" ])
98100
99101 # Set backplate RGB LED color (for supported HW only)
100- self .lcd .SetBackplateLedColor (config .THEME_DATA ['display' ].get ("DISPLAY_RGB_LED" , (255 , 255 , 255 )))
102+ self .lcd .SetBackplateLedColor (
103+ config .THEME_DATA ['display' ].get ("DISPLAY_RGB_LED" , (255 , 255 , 255 )))
101104
102105 def turn_off (self ):
103106 # Turn screen off
@@ -111,11 +114,14 @@ def display_static_images(self):
111114 for image in config .THEME_DATA ['static_images' ]:
112115 logger .debug (f"Drawing Image: { image } " )
113116 self .lcd .DisplayBitmap (
114- bitmap_path = config .THEME_DATA ['PATH' ] + config .THEME_DATA ['static_images' ][image ].get ("PATH" ),
117+ bitmap_path = config .THEME_DATA ['PATH' ] +
118+ config .THEME_DATA ['static_images' ][image ].get ("PATH" ),
115119 x = config .THEME_DATA ['static_images' ][image ].get ("X" , 0 ),
116120 y = config .THEME_DATA ['static_images' ][image ].get ("Y" , 0 ),
117- width = config .THEME_DATA ['static_images' ][image ].get ("WIDTH" , 0 ),
118- height = config .THEME_DATA ['static_images' ][image ].get ("HEIGHT" , 0 )
121+ width = config .THEME_DATA ['static_images' ][image ].get (
122+ "WIDTH" , 0 ),
123+ height = config .THEME_DATA ['static_images' ][image ].get (
124+ "HEIGHT" , 0 )
119125 )
120126
121127 def display_static_text (self ):
@@ -126,17 +132,26 @@ def display_static_text(self):
126132 text = config .THEME_DATA ['static_text' ][text ].get ("TEXT" ),
127133 x = config .THEME_DATA ['static_text' ][text ].get ("X" , 0 ),
128134 y = config .THEME_DATA ['static_text' ][text ].get ("Y" , 0 ),
129- width = config .THEME_DATA ['static_text' ][text ].get ("WIDTH" , 0 ),
130- height = config .THEME_DATA ['static_text' ][text ].get ("HEIGHT" , 0 ),
131- font = config .FONTS_DIR + config .THEME_DATA ['static_text' ][text ].get ("FONT" , "roboto-mono/RobotoMono-Regular.ttf" ),
132- font_size = config .THEME_DATA ['static_text' ][text ].get ("FONT_SIZE" , 10 ),
133- font_color = config .THEME_DATA ['static_text' ][text ].get ("FONT_COLOR" , (0 , 0 , 0 )),
134- background_color = config .THEME_DATA ['static_text' ][text ].get ("BACKGROUND_COLOR" , (255 , 255 , 255 )),
135+ width = config .THEME_DATA ['static_text' ][text ].get (
136+ "WIDTH" , 0 ),
137+ height = config .THEME_DATA ['static_text' ][text ].get (
138+ "HEIGHT" , 0 ),
139+ font = config .FONTS_DIR +
140+ config .THEME_DATA ['static_text' ][text ].get (
141+ "FONT" , "roboto-mono/RobotoMono-Regular.ttf" ),
142+ font_size = config .THEME_DATA ['static_text' ][text ].get (
143+ "FONT_SIZE" , 10 ),
144+ font_color = config .THEME_DATA ['static_text' ][text ].get (
145+ "FONT_COLOR" , (0 , 0 , 0 )),
146+ background_color = config .THEME_DATA ['static_text' ][text ].get (
147+ "BACKGROUND_COLOR" , (255 , 255 , 255 )),
135148 background_image = _get_full_path (config .THEME_DATA ['PATH' ],
136149 config .THEME_DATA ['static_text' ][text ].get ("BACKGROUND_IMAGE" ,
137150 None )),
138- align = config .THEME_DATA ['static_text' ][text ].get ("ALIGN" , "left" ),
139- anchor = config .THEME_DATA ['static_text' ][text ].get ("ANCHOR" , "lt" ),
151+ align = config .THEME_DATA ['static_text' ][text ].get (
152+ "ALIGN" , "left" ),
153+ anchor = config .THEME_DATA ['static_text' ][text ].get (
154+ "ANCHOR" , "lt" ),
140155 )
141156
142157
0 commit comments