#!/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")