⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠
Excalidraw Data
Text Elements
PROBLEM: my setup for charging stuff is weird and annoying
List of devices that must be charged nightly / close to nightly: Google Pixel 6 ( USB C ) Thinkpad X280 ( USB C ) Thinkpad X220 ( USB C ) Razer Blade 14 ( USB C ) IPhone 13 ( Lightning ) Airpods Pro ( Lightning ) Anker Power Bank ( USB C ) Baseus Power Bank ( USB C )
this is enough devices that charging is a nuisance and ugly id also like to be able to track what is charging and when and preferably integrate that into my database
so heres what im thinking
laptop
powered usb hub
leads to an ac outlet
you can use pyusb to access even contents of a usb hub
code snippet for this:
#!/usr/bin/python import sys import usb.core
find USB devices
dev = usb.core.find(find_all=True)
loop through devices, printing vendor and product ids in decimal and hex
for cfg in dev: sys.stdout.write(‘Decimal VendorID=’ + str(cfg.idVendor) + ’ & ProductID=’ + str(cfg.idProduct) + ‘\n’) sys.stdout.write(‘Hexadecimal VendorID=’ + hex(cfg.idVendor) + ’ & ProductID=’ + hex(cfg.idProduct) + ‘\n\n’)
grabbed from : https://stackoverflow.com/questions/67383908/can-we-detect-devices-connected-to-usb-hub-in-python