git clone <repository-url>
cd lametric-py
uv sync --dev
pre-commit install
Run the same checks locally that CI executes:
uv run ruff check .
uv run ruff format --check .
uv run mypy .
uv run pytest --cov=src --cov-report=term-missing
src/lametric/device.py: local device clientsrc/lametric/cloud.py: cloud API clientsrc/lametric/device_notifications.py: notification payload modelssrc/lametric/device_states.py: device and stream response modelssrc/lametric/device_apps.py: installed app modelssrc/lametric/device_configs.py: request payload models (display, screensaver, stream)src/lametric/const.py: enums and protocol constantssrc/lametric/exceptions.py: custom exception hierarchytests/: unit teststests/runtime_test.py: live integration test (requires a real device)tests/runtime_test.py exercises every public API method against a real device.
It restores write-only state (brightness, Bluetooth, etc.) after each test and
prints a pass/fail summary with exit code 0 on success.
You need:
python tests/runtime_test.py --host <ip> --api-key <key>
Example:
Connecting to 192.168.1.42 …
PASS GET /api/v2/device → DeviceState
model=LM 37X8 os=2.3.9 brightness=75 on=True
PASS GET /api/v2/device/apps → installed_apps
...
SKIP GET /api/v2/device/stream → stream_state (endpoint not supported on this firmware)
...
──────────────────────────────────────────────────
Results: 16/16 passed – all good
src/lametric/__init__.pysrc/lametric/py.typed marks the package as typed for PEP 561 consumerspyproject.toml and src/lametric/__init__.py