Home Assistant Unofficial Reference 2024.12.1
helpers.py
Go to the documentation of this file.
1 """Helpers for Agent DVR component."""
2 
3 
4 def generate_url(host, port) -> str:
5  """Create a URL from the host and port."""
6  server_origin = host
7  if "://" not in host:
8  server_origin = f"http://{host}"
9 
10  if server_origin[-1] == "/":
11  server_origin = server_origin[:-1]
12 
13  return f"{server_origin}:{port}/"