Repository navigation
feat: read a monitor's alarm state on both APIs - #58
Merged
Merged
Conversation
zm-py reads it per monitor from API v2's alarm status (zmu -s), and ha-zoneminder shows it as the camera recording and the force alarm switch's state. aiozoneminder had no way to read it on API v2; on API v3 only the event stream carried it. get_alarm_state() returns idle, prealarm, alarm or alert, or None when ZoneMinder can't say (not capturing, zmc not running). API v2 asks the monitor's own server, as alarms do; API v3 reads zm-api's live status.
# Conflicts: # CHANGELOG.md # src/aiozoneminder/client/legacy.py # tests/live/test_write.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Impact: feature (zm-py parity: the alarm state ha-zoneminder shows as recording and the force alarm switch)
TL;DR
is_recording)get_alarm_state()returnsidle/prealarm/alarm/alertor None: API v2 from the alarm status endpoint (zmu), sent to the monitor's own server; API v3 frommonitor-status/{id}'salarm_state. README row, changelog line; 9 files, +137f5ea4f5shows in this diff until fix-medium: send API v2 alarms to the monitor's own server #56 merges); merge after itCloses #57
🤖 Generated with Claude Code