bugfixes
This commit is contained in:
		
							parent
							
								
									c001ea4bcb
								
							
						
					
					
						commit
						8d932e849f
					
				
					 2 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
name: Screenshotter
 | 
					name: Screenshotter
 | 
				
			||||||
version: 1.0.1
 | 
					version: 1.0.1.1
 | 
				
			||||||
  #image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}
 | 
					  #image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}
 | 
				
			||||||
slug: screenshotter
 | 
					slug: screenshotter
 | 
				
			||||||
description: Screenshot images for E-Paper pricetags
 | 
					description: Screenshot images for E-Paper pricetags
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,11 +41,12 @@ while True:
 | 
				
			||||||
    for task in tasks:
 | 
					    for task in tasks:
 | 
				
			||||||
        if task["next_execution"] > now:
 | 
					        if task["next_execution"] > now:
 | 
				
			||||||
            continue
 | 
					            continue
 | 
				
			||||||
 | 
					        print(f"Running {task['name']}")
 | 
				
			||||||
        driver = webdriver.Chrome(options=chrome_options, desired_capabilities=d)
 | 
					        driver = webdriver.Chrome(options=chrome_options, desired_capabilities=d)
 | 
				
			||||||
        driver.implicitly_wait(10)
 | 
					        driver.implicitly_wait(10)
 | 
				
			||||||
        driver.get(task["url"])
 | 
					        driver.get(task["url"])
 | 
				
			||||||
        # pause 3 second to let page loads
 | 
					        # pause 3 second to let page loads
 | 
				
			||||||
        time.sleep(wait)
 | 
					        time.sleep(int(wait))
 | 
				
			||||||
        # save screenshot
 | 
					        # save screenshot
 | 
				
			||||||
        file_name = f'/tmp/{task["name"]}.png'
 | 
					        file_name = f'/tmp/{task["name"]}.png'
 | 
				
			||||||
        driver.save_screenshot(file_name)
 | 
					        driver.save_screenshot(file_name)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue