@@ -109,7 +109,7 @@ def SetBrightness(self, level: int = 25):
109
109
# Convert our brightness % to an absolute value.
110
110
converted_level = level * 5
111
111
112
- level_bytes = bytearray (converted_level .to_bytes (2 ))
112
+ level_bytes = bytearray (converted_level .to_bytes (2 , "big" ))
113
113
114
114
# Send the command twice because sometimes it is not applied...
115
115
self .SendCommand (cmd = Command .SETBL , payload = level_bytes )
@@ -166,10 +166,11 @@ def DisplayPILImage(
166
166
image_width , image_height = image_height , image_width
167
167
168
168
# Send bitmap size
169
- image_data = bytearray (x0 .to_bytes (2 ))
170
- image_data += bytearray (x1 .to_bytes (2 ))
171
- image_data += bytearray (y0 .to_bytes (2 ))
172
- image_data += bytearray (y1 .to_bytes (2 ))
169
+ image_data = bytearray ()
170
+ image_data += x0 .to_bytes (2 , "big" )
171
+ image_data += x1 .to_bytes (2 , "big" )
172
+ image_data += y0 .to_bytes (2 , "big" )
173
+ image_data += y1 .to_bytes (2 , "big" )
173
174
self .SendCommand (cmd = Command .BLOCKWRITE , payload = image_data )
174
175
175
176
# Prepare bitmap data transmission
0 commit comments