Commit Graph

14 Commits (366ef61544c888ae62a41f688914a78d64e858c0)

Author SHA1 Message Date
Jeff Culverhouse 07b81abecf feature: add 'version' to logged messages; upgrade packages 3 months ago
Jeff Culverhouse 1231871ba7 fix: save recording path as a string not Pathlib path; upgrade packages 3 months ago
Jeff Culverhouse de3022b920 chore: fix type, upgrade packages 3 months ago
Jeff Culverhouse 396e8b131e chore: more python support; build tests 3 months ago
Jeff Culverhouse 259d2d2475 chore: upgrade deps 3 months ago
Jeff Culverhouse 8c7bfd2b9e feat(discovery): unify service and camera discovery to new HA device schema
* Reworked publish.py and amcrest.py to emit single-payload MQTT device discovery blocks using "platform": "mqtt" and nested "cmps" for entities

* Simplified service entity publication (publish_service_discovery) into unified "device" payload

* Replaced component_type with platform throughout topics and interface definitions

* Refactored build_camera() to generate full per-camera device definition including all sensors, switches, and media links

* Updated publish_device_state() to support targeted subject/sub publishing

* Increased snapshot timeout and backoff (20s, 8s) for better camera stability

* Updated type handling in amcrest_api for network config parsing (cast from tuple or str)

* Bumped coverage dependency → 7.11.2 and refreshed json-logging-graystorm SHA
3 months ago
Jeff Culverhouse 94a4297665 refactor: fully async device setup and improved SDK value handling
- Converted device initialization and state building to async coroutines
- Parallelized Amcrest camera connections using asyncio.gather
- Added clean_value() helper for tuple/list/string SDK outputs
- Added fallback for missing DefaultInterface in network config
- Improved error handling, timeouts, and type annotations
- Verified code quality (ruff, black, mypy all passing)
3 months ago
Jeff Culverhouse 33ab97597f fix: more generic Dockerfile; remove old/; better logging for failed /media writes 3 months ago
Jeff Culverhouse a414715f26 fix: code cleanup; fix service sensors; reduce logging 3 months ago
Jeff Culverhouse 279039216c chore: upgrade lock file 3 months ago
Jeff Culverhouse 11e18b1b73 chore: move safe_publish to our helper 3 months ago
Jeff Culverhouse d8f12e6843 chore: upgrade all packages 3 months ago
Jeff Culverhouse 1d52185673 feature: move things around, cleaner code 3 months ago
Jeff Culverhouse e230a7673f feat!: complete MQTT and service refactor, add timestamp + event tracking, and new modular mixins
- Rewrote MQTT handling with reconnect, structured logging, and Home Assistant re-discovery triggers
- Introduced modular mixins (`helpers`, `mqtt`, `amcrest_api`) for cleaner architecture
- Replaced `util.py` with internal mixin helpers and `to_gb()` conversions
- Added new `event_text` and `event_time` sensors (with `device_class: timestamp`)
- Added support for doorbell and human-detection binary sensors
- Improved reconnect logic, last-will handling, and clean shutdown on signals
- Overhauled device discovery and state publishing to use unified upsert logic
- Simplified event handling and privacy mode inference from motion/human/doorbell events
- Introduced `tools/clear_mqtt.sh` for quick topic cleanup
- Added full pyproject.toml with lint/test/dev config (Black, Ruff, Pytest)
- Embedded full metadata and image labels in Docker build

BREAKING CHANGE:
Project layout moved to `src/amcrest2mqtt/`, internal class and import paths changed.
Users must update configs and volumes to the new structure before deploying.
3 months ago