tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
216 stars 76 forks source link

Change is_video_enabled to report only main stream #187

Closed flacjacket closed 3 years ago

flacjacket commented 3 years ago

The current is_video_enabled function (and video_enabled property, by extension) will mix together the main and extra (sub) streams when determining the channel to use. As such, the property will report being disabled when the substream is disabled even if the main stream is enabled. Change the behavior of the video_enabled property here to only report the main stream status on the regular encode. Add parameters to the is_video_enabled function to allow the stream and type to be selected.

flacjacket commented 3 years ago

This is related to https://github.com/home-assistant/core/issues/55661 and should provide a fix for that issue.