rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
383 stars 74 forks source link

Fix day/night mode switch #370

Closed hawkeye217 closed 2 months ago

hawkeye217 commented 2 months ago

I had recently updated my integrations and noticed that my day/night mode was no longer working. I traced it to a bug that was introduced in https://github.com/rroller/dahua/pull/327 - Non-empty Python strings are always truthy, so this statement always evaluates to True:

if 'NVR4108HS' or 'IPC-Color4K' in model:

This PR correctly searches the model string and uses an array to make it easier to add more models in the future.

rroller commented 2 months ago

Released in https://github.com/rroller/dahua/releases/tag/0.9.59

jakeycrx commented 1 month ago

My Dahua camera always returns a 401 with a RESTful command Is there any workaround for this?