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

Function _poe_watts

network_diagnostics.py:292–299  ·  view source on GitHub ↗

lldpd reports 802.3at/LLDP-MED power values in milliwatts. Convert to watts, tolerating strings and junk. Returns a float or None.

(mw)

Source from the content-addressed store, hash-verified

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 '')):

Callers 1

_parse_poeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected