Skip to content

Commit

Permalink
Fix Domain attr lookup strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandMoff100 committed Dec 22, 2024
1 parent 184f641 commit eb2c2b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homeassistant_api/models/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ def __getattr__(self, attr: str):
"""Allows services accessible as attributes"""
if attr in self.services:
return self.get_service(attr)
return super().__getattribute__(attr)
try:
return super().__getattribute__(attr)
except AttributeError as err:
try:
return object.__getattribute__(self, attr)
except AttributeError as e:
raise e from err


class ServiceField(BaseModel):
Expand Down

0 comments on commit eb2c2b0

Please sign in to comment.