Skip to content

Commit 15f2fe5

Browse files
author
Bal0o
committed
fix(hacs): respect the headless option
Fixed the handling of the headless argument in the build_ukbcd_args function to correctly pass boolean values as command-line flags.
1 parent 86709e6 commit 15f2fe5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

custom_components/uk_bin_collection/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,15 @@ def build_ukbcd_args(config_data: dict) -> list:
291291
continue
292292
if key == "web_driver" and value is not None:
293293
value = value.rstrip("/")
294-
args.append(f"--{key}={value}")
294+
args.append(f"--{key}={value}")
295+
elif key == "headless":
296+
# Handle boolean headless argument correctly
297+
if value:
298+
args.append("--headless")
299+
else:
300+
args.append("--not-headless")
301+
else:
302+
args.append(f"--{key}={value}")
295303

296304
return args
297305

custom_components/uk_bin_collection/const.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"council",
3232
"url",
3333
"skip_get_url",
34-
"headless",
3534
"local_browser",
3635
"timeout",
3736
"icon_color_mapping",

0 commit comments

Comments
 (0)