Fix rpi_camera setup hanging on initialization (#59316)
This commit is contained in:
parent
e20127d9ff
commit
2ae77bd231
1 changed files with 6 additions and 3 deletions
|
@ -119,10 +119,13 @@ class RaspberryCamera(Camera):
|
||||||
cmd_args.append("-a")
|
cmd_args.append("-a")
|
||||||
cmd_args.append(str(device_info[CONF_OVERLAY_TIMESTAMP]))
|
cmd_args.append(str(device_info[CONF_OVERLAY_TIMESTAMP]))
|
||||||
|
|
||||||
with subprocess.Popen(
|
# The raspistill process started below must run "forever" in
|
||||||
|
# the background until killed when Home Assistant is stopped.
|
||||||
|
# Therefore it must not be wrapped with "with", since that
|
||||||
|
# waits for the subprocess to exit before continuing.
|
||||||
|
subprocess.Popen( # pylint: disable=consider-using-with
|
||||||
cmd_args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT
|
cmd_args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT
|
||||||
):
|
)
|
||||||
pass
|
|
||||||
|
|
||||||
def camera_image(
|
def camera_image(
|
||||||
self, width: int | None = None, height: int | None = None
|
self, width: int | None = None, height: int | None = None
|
||||||
|
|
Loading…
Add table
Reference in a new issue