diff --git a/screenshotter/config.yaml b/screenshotter/config.yaml index 7c2a049..3f18845 100644 --- a/screenshotter/config.yaml +++ b/screenshotter/config.yaml @@ -1,6 +1,6 @@ --- name: Screenshotter -version: 1.0.1.3 +version: 1.0.1.4 #image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch} slug: screenshotter description: Screenshot images for E-Paper pricetags diff --git a/screenshotter/rootfs/app/app.py b/screenshotter/rootfs/app/app.py index e7fe888..ca43230 100644 --- a/screenshotter/rootfs/app/app.py +++ b/screenshotter/rootfs/app/app.py @@ -38,7 +38,7 @@ for image in config["images"]: while True: now = datetime.datetime.now() - for task in tasks: + for i, task in enumerate(tasks): if task["next_execution"] > now: continue print(f"Running {task['name']}") @@ -57,5 +57,5 @@ while True: image = image.rotate(int(rotate), expand=True) file_name = f'{image_path}/{task["name"]}.png' image.save(file_name) - task["next_execution"] = now + datetime.timedelta(minutes=task["period_minutes"]) + tasks[i]["next_execution"] = now + datetime.timedelta(minutes=task["period_minutes"]) time.sleep(1)