* Bumped version to 0.2.0 * Implemented Github Actions for HACS, Hassfest, Linting * Improved code quality (compliant with the linter now) * Added link to the finish page to automatically login on the same device/browser
13 lines
392 B
Python
13 lines
392 B
Python
"""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}"
|