MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / pair_bluetooth_device

Function pair_bluetooth_device

webapp_modern.py:12670–12687  ·  view source on GitHub ↗

Pair with a Bluetooth device

()

Source from the content-addressed store, hash-verified

12668 return {}
12669
12670def _detect_local_cidr():
12671 """Return the local network CIDR derived from `ip` output, or None.
12672
12673 Used as a runtime fallback when an API caller doesn't pass an explicit
12674 network=. Replaces the old hardcoded '192.168.1.0/24' default that
12675 silently scanned the wrong subnet on any non-192.168.1.x network.
12676 """
12677 try:
12678 iface = _get_wifi_iface()
12679 except Exception:
12680 iface = None
12681 candidates = [iface] if iface else []
12682 try:
12683 result = subprocess.run(
12684 ['ip', '-o', '-4', 'addr', 'show'],
12685 capture_output=True, text=True, timeout=5)
12686 if result.returncode != 0:
12687 return None
12688 except Exception:
12689 return None
12690 import ipaddress as _ipaddress

Callers

nothing calls this directly

Calls 3

pair_deviceMethod · 0.80
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected