FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
445 stars 145 forks source link

Enhanced Device Interaction and Monitoring Features #127

Open AchillesTD opened 2 months ago

AchillesTD commented 2 months ago

This PR introduces several key improvements to enhance device interaction and monitoring capabilities within the main.py file. The changes include:

  1. Detailed Device Capabilities Retrieval: Implemented functionality to fetch and display comprehensive information about device capabilities, including status and other relevant details.

  2. Streamlined RTSP URL Retrieval: Added a feature to efficiently retrieve and display RTSP stream URLs, making it easier to access live feeds.

  3. Camera Status Monitoring: Integrated real-time status updates for cameras connected to a NVR, including active/inactive status with notifications to ensure timely awareness of camera status changes. (Note: Real-time status updates are based on the state of the cameras at the time the script starts. For instance, if one of the six cameras was disconnected before running the script, you will initially see only five active cameras in the output. If that disconnected camera becomes active later, you'll receive a notification indicating that the specific camera is now active, and the total count of active cameras will update to six. Similarly, if an active camera gets disconnected, you will be notified, and the count of active cameras will decrease accordingly.)

  4. Background Polling with Threading: Introduced background polling with threading for efficient, non-blocking monitoring of camera statuses, improving system performance and responsiveness.

  5. Flexible Configuration with Environment Variables: Enhanced configuration flexibility by allowing settings to be easily adjusted via environment variables, simplifying the setup process.

  6. System Log Retrieval and Event Service Exploration: (Work in Progress) Added functionality to periodically retrieve and store system logs for better diagnostics and historical reference. Listed available operations for interacting with the event service, providing greater insight and control over event handling.

Provisional Commented-out Code:

Notes for Reviewers: Please review the changes related to real-time status updates and background threading for any potential impact on system performance. The commented-out code for event subscription is included as a placeholder and can be discussed for future integration if deemed useful. Feel free to test the new features and provide feedback or suggestions for further refinement.