Skip to content

Commit

Permalink
Changing query for DisableLinkage
Browse files Browse the repository at this point in the history
Unify the way it is done elsewhere to prevent excesive false positive retun of True when DisableLinkage is actually available and returns error from camera. After thsi fix, it is queried twice and then the integration knows it is unavailable.

Signed-off-by: Jan Dušek <[email protected]>
  • Loading branch information
jandusek4 committed Oct 12, 2024
1 parent 78d2b4c commit beee252
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions custom_components/dahua/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,7 @@ async def async_get_disarming_linkage(self) -> dict:
"""

url = "/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage"
try:
return await self.get(url)
except aiohttp.ClientResponseError as e:
return {"table.DisableLinkage.Enable": "false"}
return await self.get(url)

async def async_access_control_open_door(self, door_id: int = 1) -> dict:
"""
Expand Down

0 comments on commit beee252

Please sign in to comment.