Open si458 opened 1 year ago
im still having this issue @rroller any suggestions?
ive been able to find out the issue but im not sure how to fix it as im not an experienced python developer
STEP1: https://github.com/rroller/dahua/blob/321a576e5fee81de122c440ad28d806b519e35cc/custom_components/dahua/__init__.py#L259-L265 STEP2: https://github.com/rroller/dahua/blob/321a576e5fee81de122c440ad28d806b519e35cc/custom_components/dahua/client.py#L204-L223 STEP3: https://github.com/rroller/dahua/blob/321a576e5fee81de122c440ad28d806b519e35cc/custom_components/dahua/client.py#L195-L202
STEP 3 is returning an empty {}
as expected because of the returned 400
but then in STEP2 its just returning the empty {}
rather than catching the error to check if its a 400
then returning to STEP1 with empty {}
rather than again catching the error
when i add in my XVR5216AN (its an 16 channel BNC unit so no lighting is supported), its saying lighting is supported yet when i access the url
http://192.168.52.123/cgi-bin/configManager.cgi?action=getConfig&name=Lighting[0][0]
i clearly get a 400 error back but its showing in the logs2023-04-09 17:17:30.107 INFO (MainThread) [custom_components.dahua] Device supports infrared lighting=True
any suggestions?