diff --git a/clear_display.py b/clear_display.py new file mode 100644 index 0000000..be726f3 --- /dev/null +++ b/clear_display.py @@ -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!") diff --git a/inkycal/main.py b/inkycal/main.py index a2145b1..d1fa84f 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -532,14 +532,14 @@ class Inkycal: image = Image.fromarray(buffer) return image - def calibrate(self): + def calibrate(self, cycles=3): """Calibrate the E-Paper display 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. """ - self.Display.calibrate() + self.Display.calibrate(cycles=cycles) def _calibration_check(self): """Calibration scheduler diff --git a/inkycal/modules/inky_image.py b/inkycal/modules/inky_image.py index 340d50b..4ec859e 100755 --- a/inkycal/modules/inky_image.py +++ b/inkycal/modules/inky_image.py @@ -29,7 +29,7 @@ class Inkyimage: # give an OK message logger.info(f'{__name__} loaded') - def load(self, path): + def load(self, path:str) -> None: """loads an image from a URL or filepath. Args: