Get the first active (connected with carrier) Ethernet interface. Note: Interfaces with link-local IPs (169.254.x.x) are not considered active.
()
| 388 | # not a LAN to scan — keep it out of the Ethernet list entirely. |
| 389 | try: |
| 390 | from cellular_uplink import is_cellular |
| 391 | except Exception: # pragma: no cover - module always ships alongside |
| 392 | is_cellular = None |
| 393 | if is_cellular: |
| 394 | interfaces = {k: v for k, v in interfaces.items() if not is_cellular(k)} |
| 395 | |
| 396 | return sorted(interfaces.values(), key=lambda entry: entry['name']) |
| 397 | |
| 398 | |
| 399 | def get_active_ethernet_interface() -> Optional[Dict]: |
| 400 | """Get the first active (connected with carrier) Ethernet interface. |
| 401 | |
| 402 | Note: Interfaces with link-local IPs (169.254.x.x) are not considered active. |
| 403 | """ |
no test coverage detected