From 0bca647dff3c26dd82163a3afe83ffdfc89ac1ea Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Wed, 29 Jul 2026 17:01:31 +0000 Subject: [PATCH] custom_components/webrtc/utils.py --- custom_components/webrtc/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/custom_components/webrtc/utils.py b/custom_components/webrtc/utils.py index 7c1be1c..b6a1e7a 100644 --- a/custom_components/webrtc/utils.py +++ b/custom_components/webrtc/utils.py @@ -233,9 +233,10 @@ async def websocket_forward(ws_from, ws_to) -> None: class Server(Thread): - def __init__(self, binary: str): + def __init__(self, binary: str, config_dir: str = ""): super().__init__(name=DOMAIN, daemon=True) self.binary = binary + self.config_dir = config_dir self.process = None @property @@ -243,9 +244,12 @@ class Server(Thread): return self.process.poll() is None if self.process else False def run(self): + env = None + if self.config_dir: + env = {**__import__("os").environ, "CONFIG": self.config_dir + "/go2rtc.yaml"} while self.binary: self.process = subprocess.Popen( - [self.binary], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + [self.binary], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env ) # check alive