Add get_nvr_events and inject_events_into_camera#103
Merged
mezz64 merged 4 commits intoDec 18, 2025
Merged
Conversation
These functions extend the event detection capabilities to support NVRs with non-standard notification methods (record, email, beep) in addition to the existing 'center' and 'HTTP' methods. - get_nvr_events: Fetches events from NVR with broader notification support - inject_events_into_camera: Injects discovered events into HikCamera - HikCamera.inject_events: New method to inject events into camera's state Based on home-assistant/core#158279
Tests cover: - Parsing NVR events with various notification methods (record, email, beep, center) - Skipping videoloss events (used for watchdog) - Handling connection errors gracefully - Handling non-200 responses - Handling invalid XML - Injecting events into camera event_states - Preventing duplicate channel events
21 tasks
Contributor
Author
|
Gentle ping |
mezz64
reviewed
Dec 17, 2025
Instead of a separate get_nvr_events function, extend the existing
get_event_triggers method to accept a notification_methods parameter.
This allows users to specify which notification methods to accept
(defaults to {'center', 'HTTP'} for backwards compatibility).
For NVRs, users can pass VALID_NOTIFICATION_METHODS which includes
'record', 'email', and 'beep' in addition to the defaults.
Changes:
- Add notification_methods parameter to get_event_triggers()
- Remove duplicate get_nvr_events function
- Export VALID_NOTIFICATION_METHODS constant for easy use
- Update tests to cover new parameter functionality
mezz64
reviewed
Dec 17, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull out the
get_nvr_eventsandinject_events_into_camerafrom home-assistant/core#158279