ci/util/scrapers/fastled_python_investigation.md
This document summarizes the investigation of existing Python code in the FastLED project, particularly focusing on Playwright integration and web scraping capabilities for the FastLED online tool.
Location: All scripts are located in the ci/ci/scrapers/ directory, organized within the CI infrastructure alongside the existing testing infrastructure, including the original Playwright implementation in ci/wasm_test.py.
The project already includes comprehensive dependencies for development and testing:
playwright - for browser automationpytest, pytest-xdist for parallel testingfastled>=1.2.26 - the FastLED Python packagefastled-wasm - WebAssembly supporthttpx - for HTTP requestsuv, ziglang, ninjaruff, mypy, pyright, clang-format, isort, blackci/wasm_test.py)The project already has a sophisticated Playwright setup that:
Automatic Browser Installation:
def install_playwright_browsers():
os.system(f"{sys.executable} -m playwright install chromium")
FastLED WASM Testing:
FastLED_onFrame callback executionError Handling:
mcp_server.py)The project includes a comprehensive MCP (Model Context Protocol) server with tools for:
The FestivalStick example (examples/FestivalStick/) is a sophisticated LED pattern demo featuring:
Corkscrew LED Mapping:
fl::Corkscrew class for geometric calculationsUI Controls:
Advanced Features:
// Corkscrew configuration
#define NUM_LEDS 288
#define CORKSCREW_TURNS 19.25
// Runtime corkscrew with flexible configuration
Corkscrew::Input corkscrewInput(CORKSCREW_TURNS, NUM_LEDS, 0);
Corkscrew corkscrew(corkscrewInput);
// Frame buffer for 2D pattern drawing
fl::Grid<CRGB> frameBuffer;
// ScreenMap for web interface visualization
fl::ScreenMap corkscrewScreenMap = corkscrew.toScreenMap(0.2f);
scrape_festival_stick.py)Robust Web Navigation:
Smart Element Detection:
Screenshot Capabilities:
File Upload Attempt:
FestivalStick.inoscreenshots/ directorytests/ directorybash test (per user rules)uno, esp32, teensy, etc../compile <platform> --examples <example_name>Comprehensive Infrastructure: The FastLED project already has extensive Python tooling with Playwright, testing, and web automation capabilities.
Advanced LED Visualization: The FestivalStick example represents sophisticated LED pattern generation with real-time parameter control and web visualization.
Web Integration Ready: The existing WASM testing infrastructure provides a solid foundation for web-based LED visualization and interaction.
Documentation Gap: While the code is well-implemented, there could be more comprehensive documentation of the web tooling capabilities.
Extend Web Scraping: The created script could be enhanced to:
Integration Testing: Consider adding the web scraping script to the CI/CD pipeline for automated web interface testing.
User Documentation: Create user guides for the online FastLED tool and example usage.
✅ Successfully captured screenshot: ci/ci/scrapers/screenshots/festival_stick_20250620_224055.png (82KB)
The script successfully:
ci/ci/scrapers/scrape_festival_stick.py - Main web scraping script with Playwright automationci/ci/scrapers/run_fastled_scraper.py - Utility script for easy execution with different configurationsci/ci/scrapers/screenshots/ - Directory containing captured imagesci/ci/scrapers/screenshots/festival_stick_20250620_224055.png - Successfully captured screenshot (82KB)ci/ci/scrapers/fastled_python_investigation.md - This documentation file# Run the scraper directly from project root
uv run ci/ci/scrapers/scrape_festival_stick.py
# Use the utility script with options
uv run ci/ci/scrapers/run_fastled_scraper.py --example FestivalStick --headless --timeout 60
# Make scripts executable and run from project root
chmod +x ci/ci/scrapers/scrape_festival_stick.py ci/ci/scrapers/run_fastled_scraper.py
./ci/ci/scrapers/scrape_festival_stick.py
./ci/ci/scrapers/run_fastled_scraper.py --help
# Or run from within the scrapers directory
cd ci/ci/scrapers
uv run scrape_festival_stick.py
uv run run_fastled_scraper.py --help