Generate and audit Home Assistant test fixtures with Python
IoT FixtureKit
Local-first Python CLI for explicit IoT diagnostic fixture projection, sensitive-data linting and regression testing.
How can I create a reproducible IoT test fixture without copying an entire diagnostic response?
Use a reviewed allowlist policy to retain only the fields the test needs. FixtureKit validates field types and numeric bounds, rejects invalid selected values, and omits unknown fields. It can then audit the generated fixture for known sensitive patterns. Start with synthetic inputs.
Getting started
- Install the released Python package in a virtual environment (Python 3.9 or newer).
- Choose a synthetic input and explicit projection policy from the quickstart.
- Generate a fixture, run the local audit, and verify the consumer's real parser with a regression test.
python -m pip install iot-fixturekit==0.1.0a5
iot-fixture-audit --helpReproduce a mixed-event regression fixture
The released alpha 5 example uses one strict array policy for single-click, double-click and rotation events. Required fields must exist. Missing optional params and rotate_deg are omitted, but present invalid values fail the projection. Run these commands from a release-tag checkout in an activated virtual environment.
git clone --branch v0.1.0a5 https://github.com/FlyzDev/fixturekit.git
cd fixturekit
python -m pip install iot-fixturekit==0.1.0a5
iot-fixturekit examples/pilot/mixed-events.json --policy examples/pilot/mixed-events-policy.json --profile events > reviewed-events.json
iot-fixture-audit reviewed-events.jsonHow to interpret audit exit codes
Exit 0 means no findings under the selected heuristic rules. Exit 1 means findings were detected; exit 2 means an unreadable or invalid input or policy. Keep raw diagnostics out of Git. Test the consumer parser against the projected fixture; passing the audit alone does not prove the data is safe.
Should I replace my existing diagnostic redactor?
No. Use explicit projection and the supported profile as additional local checks. FixtureKit is intended to complement existing redaction and secret-scanning tools, not replace them. The published a5 includes generic, Tuya, Overkiz, Kasa, PyISYox and Plugwise profiles.
Compatibility and limitations
Heuristic audits are not a privacy guarantee or an automatic anonymizer. Keep existing redactors and manual review. No independent external adoption is established.