Skip to content

Commit

Permalink
Add check if attribute exists
Browse files Browse the repository at this point in the history
  • Loading branch information
samuolis committed Nov 16, 2023
1 parent 0ccfeab commit 0bfd02d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/brink_ventilation/core/brink_home_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,6 @@ async def set_mode_value(self, system_id, gateway_id, mode, ventilation, value):

def __find(self, arr , attr, value):
for x in arr:
if x[attr] == value:
return x
if hasattr(x, attr):
if x[attr] == value:
return x

0 comments on commit 0bfd02d

Please sign in to comment.