Mercurial > code > home > repos > front-door-display
diff web_to_mqtt.py @ 11:affb3c8f3f58
schedulelcd progress
author | drewp@bigasterisk.com |
---|---|
date | Thu, 06 Jun 2024 14:49:04 -0700 |
parents | 47795c3121f1 |
children |
line wrap: on
line diff
--- a/web_to_mqtt.py Thu Jun 06 14:46:07 2024 -0700 +++ b/web_to_mqtt.py Thu Jun 06 14:49:04 2024 -0700 @@ -20,14 +20,14 @@ screenshot_command = [ "google-chrome", "--headless", - "--window-size=320,480", + "--window-size=480,320", f"--screenshot={out.name}", url, ] subprocess.run(screenshot_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - return Image.open(out.name).convert('RGB') + return Image.open(out.name).convert('RGB').rotate(-90, expand=True) blockX = 32 @@ -81,11 +81,11 @@ renderer = WebRenderer() async with aiomqtt.Client("mqtt2") as client: asyncio.create_task(sendDirty(client)) - last_image = Image.new('RGB', (320, 480)) + last_image = Image.new('RGB', (320,480)) while True: last_image = await check_for_changes(renderer, client, last_image) # we could get the web page to tell us when any dom changes - await asyncio.sleep(1) + await asyncio.sleep(60) if __name__ == "__main__":