refactor: rename project to LedGrab, split HA integration into separate repo
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:
2026-04-12 22:45:28 +03:00
parent 38f73badbf
commit 02cd9d519c
548 changed files with 3502 additions and 5180 deletions
+14 -14
View File
@@ -1,7 +1,7 @@
"""Pytest configuration and shared fixtures.
IMPORTANT: This conftest patches the global config singleton BEFORE any test
module can import ``wled_controller.main``. ``main.py`` reads ``get_config()``
module can import ``ledgrab.main``. ``main.py`` reads ``get_config()``
at module level to open the database — if the singleton is not patched first,
the REAL production database (``data/ledgrab.db``) is opened and tests
read/write/delete production data.
@@ -15,10 +15,10 @@ import pytest
# ---------------------------------------------------------------------------
# ISOLATE ALL TESTS FROM PRODUCTION DATA — must happen before any test module
# imports ``wled_controller.main``.
# imports ``ledgrab.main``.
# ---------------------------------------------------------------------------
import wled_controller.config as _config_mod # noqa: E402
import ledgrab.config as _config_mod # noqa: E402
_test_tmp = Path(tempfile.mkdtemp(prefix="wled_test_"))
_test_db_path = str(_test_tmp / "test_ledgrab.db")
@@ -38,15 +38,15 @@ _config_mod.config = _test_config
# ---------------------------------------------------------------------------
from wled_controller.config import Config, StorageConfig, ServerConfig, AuthConfig # noqa: E402
from wled_controller.storage.database import Database # noqa: E402
from wled_controller.storage.device_store import Device, DeviceStore # noqa: E402
from wled_controller.storage.sync_clock import SyncClock # noqa: E402
from wled_controller.storage.sync_clock_store import SyncClockStore # noqa: E402
from wled_controller.storage.output_target_store import OutputTargetStore # noqa: E402
from wled_controller.storage.automation import Automation # noqa: E402
from wled_controller.storage.automation_store import AutomationStore # noqa: E402
from wled_controller.storage.value_source_store import ValueSourceStore # noqa: E402
from ledgrab.config import Config, StorageConfig, ServerConfig, AuthConfig # noqa: E402
from ledgrab.storage.database import Database # noqa: E402
from ledgrab.storage.device_store import Device, DeviceStore # noqa: E402
from ledgrab.storage.sync_clock import SyncClock # noqa: E402
from ledgrab.storage.sync_clock_store import SyncClockStore # noqa: E402
from ledgrab.storage.output_target_store import OutputTargetStore # noqa: E402
from ledgrab.storage.automation import Automation # noqa: E402
from ledgrab.storage.automation_store import AutomationStore # noqa: E402
from ledgrab.storage.value_source_store import ValueSourceStore # noqa: E402
# ---------------------------------------------------------------------------
@@ -244,12 +244,12 @@ def authenticated_client(test_config, monkeypatch):
Patches global config so the app uses temp storage paths.
"""
import wled_controller.config as config_mod
import ledgrab.config as config_mod
monkeypatch.setattr(config_mod, "config", test_config)
from fastapi.testclient import TestClient
from wled_controller.main import app
from ledgrab.main import app
client = TestClient(app, raise_server_exceptions=False)
client.headers["Authorization"] = "Bearer test-api-key-12345"