INNER CODE UNIT · Python

_test_homebox_connectivity

Duelion/homebox-companion · server/app.py:163

async def _test_homebox_connectivity() -> None:
    """Test connectivity to Homebox server and log diagnostic information.

    Only runs when log level is DEBUG. Helps diagnose connection issues
    by testing DNS resolution and HTTP connectivity.
    """
    if settings.log_level.upper() != "DEBUG":
        return

    import socket
    from urllib.parse import urlparse

    parsed = urlparse(settings.homebox_url)
    host = parsed.hostname
    port = parsed.port or (443 if parsed.scheme == "https" else 80)

    logger.debug(f"Connectivity test: Target URL: {settings.homebox_url}")
    logger.debug(f"Connectivity test: Parsed host: {host}, port: {port}, scheme: {parsed.scheme}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…