Add LED tool: device, CLI, web UI, build scripts, and tests

- device.py: device communication/handling
- cli.py: CLI interface updates
- web.py: web interface
- build.py, build.sh, install.sh: build and install scripts
- Pipfile: Python dependencies
- lib/mpremote: mpremote library
- test_*.py: import and LED tests
- Updated .gitignore and README

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-01 16:00:04 +13:00
parent 4a3a384181
commit accf8f06a5
17 changed files with 2821 additions and 214 deletions

43
test_imports.py Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env python3
"""Test script to verify imports work"""
import sys
import os
# Test 1: Check if file exists
transport_serial_path = 'lib/mpremote/transport_serial.py'
print(f"1. Checking if {transport_serial_path} exists...")
if os.path.exists(transport_serial_path):
print(f" ✓ File exists ({os.path.getsize(transport_serial_path)} bytes)")
else:
print(f" ✗ File does NOT exist!")
sys.exit(1)
# Test 2: Add lib to path and import
print("2. Testing imports...")
sys.path.insert(0, 'lib')
try:
from mpremote.transport_serial import SerialTransport
print(" ✓ transport_serial import works")
except Exception as e:
print(f" ✗ transport_serial import failed: {e}")
sys.exit(1)
# Test 3: Import device module
try:
import device
print(" ✓ device module import works")
except Exception as e:
print(f" ✗ device module import failed: {e}")
sys.exit(1)
# Test 4: Import cli module
try:
import cli
print(" ✓ cli module import works")
except Exception as e:
print(f" ✗ cli module import failed: {e}")
import traceback
traceback.print_exc()
sys.exit(1)
print("\n✓ All imports successful!")