Correctly handle failed Atag update in coordinator (#35473)

* delay loading configentry if update failed

* raise updatefailed on empty atagreply

* Update __init__.py

Co-authored-by: Boris Nelissen <borisnelissen91@gmail.com>
This commit is contained in:
MatsNl 2020-05-11 11:09:43 +02:00 committed by GitHub
parent 1e00fc2af7
commit 717c55d1f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,9 +163,10 @@ class AtagDataUpdateCoordinator(DataUpdateCoordinator):
with async_timeout.timeout(20):
try:
await self.atag.async_update()
if not self.atag.sensordata:
raise UpdateFailed("No data")
except (AtagException) as error:
raise UpdateFailed(error)
return self.atag.sensordata