@@ -109,7 +109,7 @@ def SetBrightness(self, level: int = 25):
109109 # Convert our brightness % to an absolute value.
110110 converted_level = level * 5
111111
112- level_bytes = bytearray (converted_level .to_bytes (2 ))
112+ level_bytes = bytearray (converted_level .to_bytes (2 , "big" ))
113113
114114 # Send the command twice because sometimes it is not applied...
115115 self .SendCommand (cmd = Command .SETBL , payload = level_bytes )
@@ -166,10 +166,11 @@ def DisplayPILImage(
166166 image_width , image_height = image_height , image_width
167167
168168 # 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" )
173174 self .SendCommand (cmd = Command .BLOCKWRITE , payload = image_data )
174175
175176 # Prepare bitmap data transmission
0 commit comments