Return default values (0) for storage stats when a camera has no SD card
instead of an empty dict. This prevents KeyError when build_device_states
tries to access storage["used"].
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Iterate over self.devices (successfully built devices) instead of
self.amcrest_devices (all API devices) in event and snapshot collection
loops. This prevents KeyError when calling is_rebooting() or
get_device_name() for devices that failed model validation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Accept any suffix variant (B/W/E/EB/EW etc.) for supported camera models
instead of requiring exact model strings. This allows cameras like
IP4M-1041W (white) to match the IP4M-1041 base model pattern.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reorganize README to focus on config.yaml as the recommended approach:
- Add dedicated Configuration section with examples for MQTT, Amcrest, and media settings
- Clearly document max_size and retention_days settings for recordings
- Move all environment variables to separate ENVIRONMENT_VARIABLES.md file
- Improve overall documentation clarity and structure
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed a crash that occurred when recordings >100MB were encountered.
The store_recording_in_media function was attempting to return file_name
outside the scope where it was defined, causing an UnboundLocalError when
get_recorded_file returned None for oversized recordings.
This fix moves the return statement inside the if recording: block and
adds an explicit return None for the case when recording is skipped.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add ignore-unfixed: true to Trivy workflow to focus on actionable vulnerabilities
- Expand .trivyignore from 1 to 10 CVEs with detailed categorization
- Document why each CVE is ignored (system libraries, unused features)
- Ignore glibc/libtasn1 system library CVEs pending upstream fixes
- Ignore curl CVEs for SSH/OAuth2/LDAP features not used by application
- Ignore OpenLDAP CVE as library is not used by amcrest2mqtt
This aligns with govee2mqtt security configuration and reduces noise
from unfixable or non-applicable security alerts while maintaining
focus on CRITICAL and HIGH severity issues that can be addressed.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change protocol_version to use 'or' fallback pattern like other config values
- Update config.yaml.sample comment to clarify both quoted and unquoted values work
- Addresses Copilot feedback on PR #3🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add configurable MQTT protocol version support to allow users to choose
between MQTT v5 (default) and v3.1.1 for broker compatibility.
Changes:
- Add protocol_version option to MQTT configuration in config.yaml.sample
- Add MQTT_PROTOCOL environment variable support in helpers.py
- Update README.md with MQTT_PROTOCOL documentation
- Update mqtt-helper-graystorm package to latest version with protocol support
The protocol_version accepts "3.1.1" or "5" (default: "5") and can be
configured via config.yaml or the MQTT_PROTOCOL environment variable.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Dependabot PRs were incorrectly triggering the docker build job.
Now release and docker jobs only run on pushes to main, scheduled
runs, and manual triggers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added badges for SBOM, provenance attestation, cosign signing, and Trivy scanning.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses deprecation warning for v3.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes mypy errors by adding cleanup_old_recordings and
cleanup_recordings_loop to AmcrestServiceProtocol.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>