USB
- class USB
Controll power state of USB devices
- classmethod all()
List all controllable USB devices
from lager import USB print(USB.all())
- Returns:
available USB devices
- Return type:
str
- classmethod find(name)
Find USB device by name
from lager import USB print(f"device found: {USB.find('ftdi')}")
- Parameters:
name (str) -- USB device name
- Returns:
device found
- Return type:
bool
- is_enabled()
Is a USB device enabled.
from lager import USB dev = USB() print(f"is device enabeld: {dev.is_enabled()}")
- Returns:
device enabled
- Return type:
bool
- on()
Power device on.
from lager import USB dev = USB() dev.on()
- off()
Power device off.
from lager import USB dev = USB() dev.off()
- toggle()
Toggle power state of device.
from lager import USB dev = USB() dev.toggle()