Fix MQTT publish for built-in motion detections#440
Merged
Conversation
Contributor
|
Thank you for your contribution to lightNVR! 🎉 Before we can merge your pull request, we need you to sign our Contributor License Agreement (CLA). Why a CLA? To sign the CLA, please reply to this comment with exactly: You only need to sign once, and it applies to all future contributions. ℹ️ More about the CLAThe CLA grants OpenSensor Engineering the right to:
You retain copyright of your contributions and can use them in other projects. |
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.
Summary
Why
The built-in motion detection path stores thresholded detections in the database, but unlike the API detection path it did not call
mqtt_publish_detection()ormqtt_set_motion_state(). As a result, Home Assistant discovery topics were created, snapshots continued to publish, but these state topics did not update for streams usingmodel=motion:lightnvr/cameras/<stream>/motionlightnvr/cameras/<stream>/detection_countlightnvr/detections/<stream>Testing
git diff --check.cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DENABLE_SOD=OFF \ -DENABLE_GO2RTC=OFF \ -DBUILD_TESTS=OFF cmake --build . -j2build/bin/lightnvrwas produced.