diff --git a/kvmd/apps/oled/__init__.py b/kvmd/apps/oled/__init__.py index db96ca2c..5e23d3b7 100644 --- a/kvmd/apps/oled/__init__.py +++ b/kvmd/apps/oled/__init__.py @@ -78,6 +78,7 @@ def main() -> None: # pylint: disable=too-many-locals,too-many-branches,too-man parser.add_argument("--image", default="", type=(lambda arg: _get_data_path("pics", arg)), help="Display some image, wait a single interval and exit") parser.add_argument("--text", default="", help="Display some text, wait a single interval and exit") parser.add_argument("--pipe", action="store_true", help="Read and display lines from stdin until EOF, wait a single interval and exit") + parser.add_argument("--fill", action="store_true", help="Fill the display with 0xFF") parser.add_argument("--clear-on-exit", action="store_true", help="Clear display on exit") parser.add_argument("--contrast", default=64, type=int, help="Set OLED contrast, values from 0 to 255") parser.add_argument("--fahrenheit", action="store_true", help="Display temperature in Fahrenheit instead of Celsius") @@ -121,6 +122,9 @@ def main() -> None: # pylint: disable=too-many-locals,too-many-branches,too-man text = "" time.sleep(options.interval) + elif options.fill: + screen.draw_white() + else: stop_reason: (str | None) = None diff --git a/kvmd/apps/oled/screen.py b/kvmd/apps/oled/screen.py index 0e3301bb..5f0e0613 100644 --- a/kvmd/apps/oled/screen.py +++ b/kvmd/apps/oled/screen.py @@ -52,3 +52,7 @@ class Screen: def draw_image(self, image_path: str) -> None: with luma_canvas(self.__device) as draw: draw.bitmap(self.__offset, Image.open(image_path).convert("1"), fill="white") + + def draw_white(self) -> None: + with luma_canvas(self.__device) as draw: + draw.rectangle((0, 0, self.__device.width, self.__device.height), fill="white")