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

Repeated error preventing correct operation in HA #189

Closed FrnchFrgg closed 3 years ago

FrnchFrgg commented 3 years ago

This is a regression from 1.7.2.

A long time ago, some devices (including my Dahua doorbell) were choking (returning 400 Bad Request) on the RecordMode getConfig which prevented normal operation of the home assistant integration. The API request was then wrapped in a try block to avoid that problem. Since 6d1f617fac the problem is back since as par of the refactoring the try block was lost. My doorbell is still capable of relaying events (button, nfc, ntp, etc.) to HA, of taking snapshots, but the camera stream is no longer working due to problems in camera attributes.

Could you reinstate the try block as it were for compatibility ?

flacjacket commented 3 years ago

Thanks for the information. Does the fix in #190 look like it will handle the errors that you are seeing? I also added a comment there that I think describes the problem that you are seeing which necessitates the try/except block.