Skip to content

Commit

Permalink
Merge pull request OpenEPaperLink#129 from gertlind/main
Browse files Browse the repository at this point in the history
Update imagegen.py
  • Loading branch information
jonasniesner authored Mar 15, 2024
2 parents 390c520 + cc59a5c commit 4897117
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/open_epaper_link/imagegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,13 @@ def customimage(entity_id, service, hass):
font_file = os.path.join(os.path.dirname(__file__), font)
font = ImageFont.truetype(font_file, size)
color = element.get('color', "black")
anchor = element.get('anchor', "lm")
_LOGGER.debug("Got Multiline string: %s with delimiter: %s" % (element['value'],element["delimiter"]))
lst = element['value'].replace("\n","").split(element["delimiter"])
pos = element.get('start_y', pos_y + element.get('y_padding', 10))
for elem in lst:
_LOGGER.debug("String: %s" % (elem))
d.text((element['x'], pos ), str(elem), fill=getIndexColor(color), font=font)
d.text((element['x'], pos ), str(elem), fill=getIndexColor(color), font=font, anchor=anchor)
pos = pos + element['offset_y']
pos_y = pos
#icon
Expand Down

0 comments on commit 4897117

Please sign in to comment.