implement clear-display script
This commit is contained in:
parent
796a896c34
commit
d231716c0b
12
clear_display.py
Normal file
12
clear_display.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
"""
|
||||||
|
Clears the display of any content.
|
||||||
|
"""
|
||||||
|
from inkycal import Inkycal
|
||||||
|
|
||||||
|
print("loading Inkycal and display driver...")
|
||||||
|
inky = Inkycal(render=True) # Initialise Inkycal
|
||||||
|
print("clearing display...")
|
||||||
|
inky.calibrate(cycles=1) # Calibrate the display
|
||||||
|
print("clear complete...")
|
||||||
|
|
||||||
|
print("finished!")
|
@ -532,14 +532,14 @@ class Inkycal:
|
|||||||
image = Image.fromarray(buffer)
|
image = Image.fromarray(buffer)
|
||||||
return image
|
return image
|
||||||
|
|
||||||
def calibrate(self):
|
def calibrate(self, cycles=3):
|
||||||
"""Calibrate the E-Paper display
|
"""Calibrate the E-Paper display
|
||||||
|
|
||||||
Uses the Display class to calibrate the display with the default of 3
|
Uses the Display class to calibrate the display with the default of 3
|
||||||
cycles. After a refresh cycle, a new image is generated and shown.
|
cycles. After a refresh cycle, a new image is generated and shown.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.Display.calibrate()
|
self.Display.calibrate(cycles=cycles)
|
||||||
|
|
||||||
def _calibration_check(self):
|
def _calibration_check(self):
|
||||||
"""Calibration scheduler
|
"""Calibration scheduler
|
||||||
|
@ -29,7 +29,7 @@ class Inkyimage:
|
|||||||
# give an OK message
|
# give an OK message
|
||||||
logger.info(f'{__name__} loaded')
|
logger.info(f'{__name__} loaded')
|
||||||
|
|
||||||
def load(self, path):
|
def load(self, path:str) -> None:
|
||||||
"""loads an image from a URL or filepath.
|
"""loads an image from a URL or filepath.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
Loading…
Reference in New Issue
Block a user