From fab82bf362619ab87eab5156749a238cb60d1deb Mon Sep 17 00:00:00 2001 From: Jonas Niesner Date: Sat, 24 Feb 2024 12:12:49 +0100 Subject: [PATCH] Update __init__.py --- custom_components/open_epaper_link/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/custom_components/open_epaper_link/__init__.py b/custom_components/open_epaper_link/__init__.py index 93e14bf..3e78224 100644 --- a/custom_components/open_epaper_link/__init__.py +++ b/custom_components/open_epaper_link/__init__.py @@ -36,13 +36,15 @@ async def drawcustomservice(service: ServiceCall) -> None: dither = service.data.get("dither", False) ttl = service.data.get("ttl", 60) + preloadtype = service.data.get("preloadtype", 0) + preloadlut = service.data.get("preloadlut", 0) dry_run = service.data.get("dry-run", False) for entity_id in entity_ids: _LOGGER.info("Called entity_id: %s" % (entity_id)) imgbuff = await hass.async_add_executor_job(customimage,entity_id, service, hass) id = entity_id.split(".") if (dry_run is False): - result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip, dither,ttl,hass) + result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip, dither,ttl,preloadtype,preloadlut,hass) else: _LOGGER.info("Running dry-run - no upload to AP!") result = True @@ -56,7 +58,7 @@ async def dlimg(service: ServiceCall) -> None: _LOGGER.info("Called entity_id: %s" % (entity_id)) id = entity_id.split(".") imgbuff = await hass.async_add_executor_job(downloadimg, entity_id, service, hass) - result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip, dither,300,hass) + result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip, dither,300,0,0,hass) # callback for the 5 line service(depricated) async def lines5service(service: ServiceCall) -> None: @@ -66,7 +68,7 @@ async def lines5service(service: ServiceCall) -> None: _LOGGER.info("Called entity_id: %s" % (entity_id)) imgbuff = gen5line(entity_id, service, hass) id = entity_id.split(".") - result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip,False,300,hass) + result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip,False,300,0,0,hass) # callback for the 4 line service(depricated) async def lines4service(service: ServiceCall) -> None: @@ -76,7 +78,7 @@ async def lines4service(service: ServiceCall) -> None: _LOGGER.info("Called entity_id: %s" % (entity_id)) imgbuff = gen4line(entity_id, service, hass) id = entity_id.split(".") - result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip,False,300,hass) + result = await hass.async_add_executor_job(uploadimg, imgbuff, id[1], ip,False,300,0,0,hass) # callback for the setled service async def setled(service: ServiceCall) -> None: