cokeman0 / OpenEpaperElectricPriceTag

OpenEpaper Electric price tag with 12h graf
7 stars 1 forks source link

automation fails if electricity prices are negative #4

Closed HejkonBacon closed 6 months ago

HejkonBacon commented 6 months ago

Tonight at 23.00, prices here in Sweden will go below 0 SEK/kWh, resulting in the automation stopping.

File "/config/custom_components/open_epaper_link/imagegen.py", line 145, in customimage img_rect.rectangle([(element['x_start'],element['y_start']),(element['x_end'],element['y_end'])],fill = getIndexColor(element['fill']), outline=getIndexColor(element['outline']), width=element['width']) File "/usr/local/lib/python3.12/site-packages/PIL/ImageDraw.py", line 303, in rectangle self.draw.draw_rectangle(xy, fill, 1)

ValueError: y1 must be greater than or equal to y0

johansolve commented 6 months ago

This is fixed in pull request #6