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:
@@ -4,7 +4,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
|
||||
import pytest
|
||||
|
||||
from wled_controller.storage.device_store import Device, DeviceStore
|
||||
from ledgrab.storage.device_store import Device, DeviceStore
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -14,7 +14,8 @@ from wled_controller.storage.device_store import Device, DeviceStore
|
||||
|
||||
@pytest.fixture
|
||||
def tmp_db(tmp_path):
|
||||
from wled_controller.storage.database import Database
|
||||
from ledgrab.storage.database import Database
|
||||
|
||||
db = Database(tmp_path / "test.db")
|
||||
yield db
|
||||
db.close()
|
||||
@@ -95,8 +96,13 @@ class TestDeviceModel:
|
||||
|
||||
def test_to_dict_includes_non_defaults(self):
|
||||
d = Device(
|
||||
device_id="d", name="D", url="http://x", led_count=10,
|
||||
rgbw=True, tags=["a"], software_brightness=100,
|
||||
device_id="d",
|
||||
name="D",
|
||||
url="http://x",
|
||||
led_count=10,
|
||||
rgbw=True,
|
||||
tags=["a"],
|
||||
software_brightness=100,
|
||||
)
|
||||
data = d.to_dict()
|
||||
assert data["rgbw"] is True
|
||||
@@ -243,7 +249,8 @@ class TestDeviceNameUniqueness:
|
||||
|
||||
class TestDevicePersistence:
|
||||
def test_persistence_across_instances(self, tmp_path):
|
||||
from wled_controller.storage.database import Database
|
||||
from ledgrab.storage.database import Database
|
||||
|
||||
db = Database(tmp_path / "persist.db")
|
||||
s1 = DeviceStore(db)
|
||||
d = s1.create_device(name="Persist", url="http://p", led_count=77)
|
||||
@@ -256,7 +263,8 @@ class TestDevicePersistence:
|
||||
db.close()
|
||||
|
||||
def test_update_persists(self, tmp_path):
|
||||
from wled_controller.storage.database import Database
|
||||
from ledgrab.storage.database import Database
|
||||
|
||||
db = Database(tmp_path / "persist2.db")
|
||||
s1 = DeviceStore(db)
|
||||
d = s1.create_device(name="Before", url="http://x", led_count=10)
|
||||
@@ -274,7 +282,8 @@ class TestDevicePersistence:
|
||||
|
||||
class TestDeviceThreadSafety:
|
||||
def test_concurrent_creates(self, tmp_path):
|
||||
from wled_controller.storage.database import Database
|
||||
from ledgrab.storage.database import Database
|
||||
|
||||
db = Database(tmp_path / "conc.db")
|
||||
s = DeviceStore(db)
|
||||
errors = []
|
||||
|
||||
Reference in New Issue
Block a user