refactor: rename project to LedGrab, split HA integration into separate repo
Lint & Test / test (push) Successful in 1m56s
Lint & Test / test (push) Successful in 1m56s
- Rename Python package: wled_controller -> ledgrab - Rename env var prefix: WLED_ -> LEDGRAB_ (with auto-migration for old vars) - Rename localStorage key: wled_api_key -> ledgrab_api_key (with migration) - Rename HA integration domain: wled_screen_controller -> ledgrab - Update all imports, build scripts, Docker, installer, config, docs - Remove HA integration (moved to ledgrab-haos-integration repo) - Remove hacs.json (belongs in HA repo now) - Add startup warning for users with old WLED_ env vars - All tests pass (715/715), ruff clean, tsc clean, frontend builds
This commit is contained in:
@@ -6,7 +6,7 @@ import sys
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from wled_controller.core.capture.screen_capture import (
|
||||
from ledgrab.core.capture.screen_capture import (
|
||||
get_available_displays,
|
||||
capture_display,
|
||||
extract_border_pixels,
|
||||
@@ -18,7 +18,9 @@ from wled_controller.core.capture.screen_capture import (
|
||||
)
|
||||
|
||||
# Skip tests that require a real display on headless CI
|
||||
_has_display = bool(os.environ.get("DISPLAY") or sys.platform == "win32" or sys.platform == "darwin")
|
||||
_has_display = bool(
|
||||
os.environ.get("DISPLAY") or sys.platform == "win32" or sys.platform == "darwin"
|
||||
)
|
||||
requires_display = pytest.mark.skipif(not _has_display, reason="No display available (headless CI)")
|
||||
|
||||
|
||||
@@ -66,12 +68,7 @@ def test_extract_border_pixels():
|
||||
"""Test extracting border pixels."""
|
||||
# Create a test screen capture
|
||||
test_image = np.random.randint(0, 256, (100, 200, 3), dtype=np.uint8)
|
||||
capture = ScreenCapture(
|
||||
image=test_image,
|
||||
width=200,
|
||||
height=100,
|
||||
display_index=0
|
||||
)
|
||||
capture = ScreenCapture(image=test_image, width=200, height=100, display_index=0)
|
||||
|
||||
border_width = 10
|
||||
borders = extract_border_pixels(capture, border_width)
|
||||
@@ -86,12 +83,7 @@ def test_extract_border_pixels():
|
||||
def test_extract_border_pixels_invalid_width():
|
||||
"""Test extracting borders with invalid width."""
|
||||
test_image = np.random.randint(0, 256, (100, 200, 3), dtype=np.uint8)
|
||||
capture = ScreenCapture(
|
||||
image=test_image,
|
||||
width=200,
|
||||
height=100,
|
||||
display_index=0
|
||||
)
|
||||
capture = ScreenCapture(image=test_image, width=200, height=100, display_index=0)
|
||||
|
||||
# Border width too small
|
||||
with pytest.raises(ValueError):
|
||||
|
||||
Reference in New Issue
Block a user