diff --git a/screenshotter/config.yaml b/screenshotter/config.yaml index a00a268..f1707ea 100644 --- a/screenshotter/config.yaml +++ b/screenshotter/config.yaml @@ -1,6 +1,6 @@ --- name: Screenshotter -version: 1.0.1.5 +version: 1.0.1.6 #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 680d181..1a9546a 100644 --- a/screenshotter/rootfs/app/app.py +++ b/screenshotter/rootfs/app/app.py @@ -49,9 +49,9 @@ while True: driver.get(task["url"]) time.sleep(int(wait)) - if task["ha_auth"]: + if task.get("ha_auth"): print("Doing HA Auth") - driver.execute_script(f"window.localStorage.setItem('hassTokens', {hassUrl: '{ha_url}', access_token: '{ha_token}', token_type: 'Bearer'});") + driver.execute_script(f"window.localStorage.setItem('hassTokens', {{hassUrl: '{ha_url}', access_token: '{ha_token}', token_type: 'Bearer'}});") driver.get(task["url"]) time.sleep(int(wait))