"""Helper functions for the integration.""" from homeassistant.components import http def get_url(path: str) -> str: """Returns the requested path appended to the current request base URL.""" if (req := http.current_request.get()) is None: raise RuntimeError("No current request in context") base_uri = str(req.url).split("/auth", 2)[0] return f"{base_uri}{path}"