smartscreen-driver 0.2.2__tar.gz → 0.2.3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smartscreen-driver
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Driver for serial-over-USB displays; library extracted from turing-smart-screen-python
5
5
  Project-URL: homepage, https://github.com/hchargois/smartscreen-driver
6
6
  Author-email: Hugo Chargois <hugo.chargois@free.fr>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smartscreen-driver"
3
- version = "0.2.2"
3
+ version = "0.2.3"
4
4
  description = "Driver for serial-over-USB displays; library extracted from turing-smart-screen-python"
5
5
  authors = [
6
6
  { name="Hugo Chargois", email="hugo.chargois@free.fr" },
@@ -152,14 +152,17 @@ class LcdCommRevA(LcdComm):
152
152
  self.open_serial()
153
153
 
154
154
  def clear(self):
155
- self.set_orientation(
156
- Orientation.PORTRAIT
157
- ) # Bug: orientation needs to be PORTRAIT before clearing
155
+ # Bug: orientation needs to be PORTRAIT before clearing
156
+ backup_orientation = self.orientation
157
+ self.set_orientation(Orientation.PORTRAIT)
158
+
158
159
  if self.sub_revision == SubRevision.TURING_3_5:
159
160
  self.send_command(Command.TO_BLACK, 0, 0, 0, 0)
160
161
  else:
161
162
  self.send_command(Command.CLEAR, 0, 0, 0, 0)
162
- self.set_orientation() # Restore default orientation
163
+
164
+ # Restore previous orientation
165
+ self.set_orientation(backup_orientation)
163
166
 
164
167
  def screen_off(self):
165
168
  self.send_command(Command.SCREEN_OFF, 0, 0, 0, 0)