lametric-py

Development

Setup

git clone <repository-url>
cd lametric-py
uv sync --dev
pre-commit install

Quality Gates

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

Project Layout

Runtime Integration Test

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

Packaging Notes