Skip to content

Commit

Permalink
only add doors when is_bind_hub is True
Browse files Browse the repository at this point in the history
  • Loading branch information
imhotep committed Nov 3, 2023
1 parent 0cc98f1 commit aebfc92
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions custom_components/unifi_access/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ def update(self):
doors: list[UnifiAccessDoor] = []

for i, door in enumerate(data):
doors.append(
UnifiAccessDoor(
door_id=door["id"],
name=door["name"],
door_position_status=door["door_position_status"],
door_lock_relay_status=door["door_lock_relay_status"],
api=self,
if door["is_bind_hub"] == True:
doors.append(
UnifiAccessDoor(
door_id=door["id"],
name=door["name"],
door_position_status=door["door_position_status"],
door_lock_relay_status=door["door_lock_relay_status"],
api=self,
)
)
)

return doors

Expand Down

0 comments on commit aebfc92

Please sign in to comment.