Hue to retry if hub errors out (#31616)

* Respect semaphore

* Add retries when connection reset

* Also catch OSError from aiohttp when authenticating
This commit is contained in:
Paulus Schoutsen 2020-02-08 13:20:37 -08:00 committed by GitHub
parent 0dd151c1c3
commit 989dd32258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 28 deletions

View file

@ -55,7 +55,7 @@ class SensorManager:
try:
with async_timeout.timeout(4):
return await self.bridge.async_request_call(
self.bridge.api.sensors.update()
self.bridge.api.sensors.update
)
except Unauthorized:
await self.bridge.handle_unauthorized_error()