chrome language options
This commit is contained in:
parent
26c4e52864
commit
f168fba23a
2 changed files with 6 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: E-Paper Screenshotter
|
||||
version: 1.0.1.15
|
||||
version: 1.0.1.16
|
||||
#image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}
|
||||
slug: screenshotter
|
||||
description: Screenshot images for E-Paper pricetags
|
||||
|
|
|
@ -7,9 +7,6 @@ import yaml
|
|||
import datetime
|
||||
import croniter
|
||||
|
||||
# enable browser logging
|
||||
d = DesiredCapabilities.CHROME
|
||||
d['loggingPrefs'] = {'browser': 'ALL'}
|
||||
|
||||
image_path = os.environ.get("SCREEN_IMAGE_PATH", default='/tmp')
|
||||
config_file = os.environ.get("SCREEN_CONFIG", default="/app/config.yaml")
|
||||
|
@ -21,14 +18,19 @@ ha_url = os.environ.get("SCREEN_HA_URL", default="")
|
|||
ha_token = os.environ.get("SCREEN_HA_TOKEN", default="")
|
||||
ha_language = os.environ.get("SCREEN_HA_LANGUAGE", default="en")
|
||||
|
||||
# enable browser logging
|
||||
d = DesiredCapabilities.CHROME
|
||||
d['loggingPrefs'] = {'browser': 'ALL'}
|
||||
# Open another headless browser with height extracted above
|
||||
chrome_options = Options()
|
||||
chrome_options.add_argument("--headless")
|
||||
chrome_options.add_argument('--no-sandbox')
|
||||
chrome_options.add_argument(f"--window-size={width},{height}")
|
||||
chrome_options.add_argument(f"--lang={ha_language}")
|
||||
chrome_options.add_argument("--hide-scrollbars")
|
||||
chrome_options.add_argument('user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, '
|
||||
'like Gecko) Chrome/68.0.3440.84 Safari/537.36')
|
||||
chrome_options.add_experimental_option('prefs', {'intl.accept_languages': ha_language})
|
||||
|
||||
config = None
|
||||
with open(config_file, "r") as stream:
|
||||
|
|
Loading…
Reference in a new issue