@@ -117,14 +117,21 @@ def InitializeComm(self):
117117 self .Hello ()
118118
119119 def Reset (self ):
120- # HW revision B does not implement a command to reset it: clear the screen instead
121- self . Clear ()
120+ # HW revision B does not implement a command to reset it
121+ pass
122122
123123 def Clear (self ):
124124 # HW revision B does not implement a Clear command: display a blank image on the whole screen
125+ # Force an orientation in case the screen is currently configured with one different from the theme
126+ backup_orientation = self .orientation
127+ self .SetOrientation (orientation = Orientation .PORTRAIT )
128+
125129 blank = Image .new ("RGB" , (self .get_width (), self .get_height ()), (255 , 255 , 255 ))
126130 self .DisplayPILImage (blank )
127131
132+ # Restore orientation
133+ self .SetOrientation (orientation = backup_orientation )
134+
128135 def ScreenOff (self ):
129136 # HW revision B does not implement a "ScreenOff" native command: using SetBrightness(0) instead
130137 self .SetBrightness (0 )
@@ -148,8 +155,10 @@ def SetBrightness(self, level_user: int = 25):
148155 self .SendCommand (Command .SET_BRIGHTNESS , payload = [level ])
149156
150157 def SetBackplateLedColor (self , led_color : Tuple [int , int , int ] = (255 , 255 , 255 )):
158+ if isinstance (led_color , str ):
159+ led_color = tuple (map (int , led_color .split (', ' )))
151160 if self .is_flagship ():
152- self .SendCommand (Command .SET_LIGHTING , payload = led_color )
161+ self .SendCommand (Command .SET_LIGHTING , payload = list ( led_color ) )
153162 else :
154163 logger .info ("Only HW revision 'flagship' supports backplate LED color setting" )
155164
0 commit comments