@@ -74,11 +74,13 @@ def __init__(self):
74
74
self .lcd = LcdSimulated (display_width = 480 ,
75
75
display_height = 800 )
76
76
else :
77
- logger .error ("Unknown display revision '" , config .CONFIG_DATA ["display" ]["REVISION" ], "'" )
77
+ logger .error ("Unknown display revision '" ,
78
+ config .CONFIG_DATA ["display" ]["REVISION" ], "'" )
78
79
79
80
def initialize_display (self ):
80
81
# 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 ()
82
84
83
85
# Send initialization commands
84
86
self .lcd .InitializeComm ()
@@ -97,7 +99,8 @@ def turn_on(self):
97
99
self .lcd .SetBrightness (config .CONFIG_DATA ["display" ]["BRIGHTNESS" ])
98
100
99
101
# 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 )))
101
104
102
105
def turn_off (self ):
103
106
# Turn screen off
@@ -111,11 +114,14 @@ def display_static_images(self):
111
114
for image in config .THEME_DATA ['static_images' ]:
112
115
logger .debug (f"Drawing Image: { image } " )
113
116
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" ),
115
119
x = config .THEME_DATA ['static_images' ][image ].get ("X" , 0 ),
116
120
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 )
119
125
)
120
126
121
127
def display_static_text (self ):
@@ -126,17 +132,26 @@ def display_static_text(self):
126
132
text = config .THEME_DATA ['static_text' ][text ].get ("TEXT" ),
127
133
x = config .THEME_DATA ['static_text' ][text ].get ("X" , 0 ),
128
134
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 )),
135
148
background_image = _get_full_path (config .THEME_DATA ['PATH' ],
136
149
config .THEME_DATA ['static_text' ][text ].get ("BACKGROUND_IMAGE" ,
137
150
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" ),
140
155
)
141
156
142
157
0 commit comments