Enable monochrome mode

This commit is contained in:
Jan-Henrik 2023-02-18 22:29:45 +01:00
parent 0e6d3748d2
commit af278c323a
2 changed files with 3 additions and 1 deletions

View file

@ -1,6 +1,6 @@
---
name: E-Paper Screenshotter
version: 1.0.1.34
version: 1.0.1.35
#image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}
slug: screenshotter
description: Screenshot images for E-Paper pricetags

View file

@ -87,6 +87,8 @@ while True:
browser_out += f"{entry}\n"
logging.info(browser_out)
image = Image.open(file_name)
if task.get("monochrome") and task.get("monochrome") == "true":
image = image.convert('1', dither=Image.NONE)
image = image.rotate(int(rotate), expand=True)
file_name = f'{image_path}/{task["name"]}.png'
image.save(file_name)