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:
35
test_led_simple.py
Normal file
35
test_led_simple.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Simple test for LED count update"""
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add current directory to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# Test the edit logic
|
||||
edits = {}
|
||||
args_leds = 100
|
||||
|
||||
if args_leds is not None:
|
||||
edits["num_leds"] = args_leds
|
||||
|
||||
print("Edits:", edits)
|
||||
|
||||
# Simulate --no-download
|
||||
settings = {}
|
||||
|
||||
# Apply edits
|
||||
if edits:
|
||||
print(f"Applying {len(edits)} edit(s)...")
|
||||
settings.update(edits)
|
||||
|
||||
# Print settings (this is what print_settings does)
|
||||
print("\nOutput JSON:")
|
||||
print(json.dumps(settings, indent=2))
|
||||
|
||||
# Verify
|
||||
if settings.get("num_leds") == 100:
|
||||
print("\n✓ SUCCESS: num_leds is correctly set to 100")
|
||||
else:
|
||||
print(f"\n✗ FAILED: num_leds is {settings.get('num_leds')}, expected 100")
|
||||
Reference in New Issue
Block a user