lldpd reports 802.3at/LLDP-MED power values in milliwatts. Convert to watts, tolerating strings and junk. Returns a float or None.
(mw)
| 290 | """Locate a speedtest client and learn how it can pin an interface. |
| 291 | |
| 292 | Returns (kind, exe): kind 'ookla' (supports --interface, a real device bind) |
| 293 | or 'cli' (the python speedtest-cli, which only offers --source). |
| 294 | |
| 295 | Do NOT infer the client from the binary name: on Debian/Raspberry Pi OS |
| 296 | /usr/bin/speedtest is usually just an entry-point alias for the python |
| 297 | speedtest-cli and rejects --interface outright. Ask --help instead.""" |
| 298 | for name in ('speedtest', 'speedtest-cli'): |
| 299 | if not _have(name): |
| 300 | continue |
| 301 | h = _run([name, '--help'], timeout=10) |
| 302 | if '--interface' in ((h['out'] or '') + (h['err'] or '')): |