mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
oled: --fill option to test the display
This commit is contained in:
parent
fbf5e52b0f
commit
49638ed896
@ -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
|
||||
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user