This repository provides a maintained Python package and CLI for the UNI-T UT383BT Bluetooth lux meter. Changes must remain safe to test without physical hardware.
src/ut383bt/: maintained package.tests/: deterministic unit and async tests; never use a live radio.docs/: architecture, API, protocol, and troubleshooting references..github/: repository automation and contribution templates.
- Support Python 3.11 and newer.
- Keep BLE operations asynchronous.
- Use an explicit user-provided device identifier; never commit a personal address or macOS UUID.
- Use Bleak's async context manager so disconnection always occurs.
- Always pass the GATT
responsechoice explicitly. - Keep parsing pure and independent from BLE so captured packets are testable offline.
- Treat notification data as untrusted input. Bound, validate, and reject it without crashing a capture.
- Store timestamps as timezone-aware UTC.
- Do not add live-hardware tests to CI.
- Update public documentation and
CHANGELOG.mdwith user-visible behavior.
python -m pip install --editable ".[dev]"
ruff check .
ruff format --check .
pytest
python -m build
pip-audit
git diff --checkCoverage must remain at or above 95%.
Use signed Conventional Commits and focused PRs. Include the affected operating systems, sanitized device behavior, validation evidence, and any manual hardware checks. Never include a real device identifier, sensitive measurement log, or Bluetooth diagnostic containing personal data.