"""Integration test configuration.""" from __future__ import annotations import os import pytest def integration_enabled() -> bool: return os.environ.get("SHELLY_INTEGRATION", "").strip().lower() in ( "1", "true", "yes", "on", ) def mdns_timeout_sec() -> float: raw = os.environ.get("SHELLY_MDNS_SECONDS", "6") try: return max(2.0, float(raw)) except ValueError: return 6.0 def subnet_cidr() -> str | None: c = os.environ.get("SHELLY_SUBNET", "").strip() return c or None requires_integration = pytest.mark.skipif( not integration_enabled(), reason="Set SHELLY_INTEGRATION=1 to run LAN tests (see README).", )