Skip to content
Snippets Groups Projects
Verified Commit 840e6c9e authored by rahix's avatar rahix
Browse files

fix(display): Refactor open & close


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 4a01205c
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,12 @@ class Display: ...@@ -15,6 +15,12 @@ class Display:
disp.clear().update() disp.clear().update()
""" """
def __init__(self):
"""
Opens the display. Will fail the display can't be locked
"""
sys_display.open()
def __enter__(self): def __enter__(self):
return self return self
...@@ -26,10 +32,10 @@ class Display: ...@@ -26,10 +32,10 @@ class Display:
""" """
Opens the display. Will fail the display can't be locked Opens the display. Will fail the display can't be locked
""" """
sys_display.open()
return cls() return cls()
def close(self): @staticmethod
def close():
""" """
Closes and unlocks the display. To be able to use it again, Closes and unlocks the display. To be able to use it again,
it is necessary to open and lock it again with Display.open() it is necessary to open and lock it again with Display.open()
...@@ -126,3 +132,4 @@ class Display: ...@@ -126,3 +132,4 @@ class Display:
return self return self
open = Display.open open = Display.open
close = Display.close
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment