Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
temp fix for hass is none issue
Browse files Browse the repository at this point in the history
  • Loading branch information
eavanvalkenburg committed Jul 17, 2020
1 parent b82a43d commit cc42e76
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions custom_components/sia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,18 @@ async def update_states(self, event: SIAEvent):
"last_message": f"{utcnow().isoformat()}: SIA: {event.sia_string}, Message: {event.message}"
}
)

for entity in self.states.values():
if entity.account == event.account and not isinstance(entity, SIASensor):
try:
await entity.assume_available()
except Exception:
pass

await asyncio.gather(
*[
entity.assume_available()
for entity in self.states.values()
if entity.account == event.account and not isinstance(entity, SIASensor)
]
)
# await asyncio.gather(
# *[
# entity.assume_available()
# for entity in self.states.values()
# if entity.account == event.account and not isinstance(entity, SIASensor)
# ]
# )

0 comments on commit cc42e76

Please sign in to comment.