Catch more Hue errors (#32275)

This commit is contained in:
Paulus Schoutsen 2020-02-27 12:53:36 -08:00 committed by GitHub
parent ecd076c5e4
commit 5a56d0ec1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 5 deletions

View file

@ -3,6 +3,7 @@ import asyncio
from datetime import timedelta
import logging
from aiohttp import client_exceptions
from aiohue import AiohueException, Unauthorized
from aiohue.sensors import TYPE_ZLL_PRESENCE
import async_timeout
@ -60,7 +61,7 @@ class SensorManager:
except Unauthorized:
await self.bridge.handle_unauthorized_error()
raise UpdateFailed
except (asyncio.TimeoutError, AiohueException):
except (asyncio.TimeoutError, AiohueException, client_exceptions.ClientError):
raise UpdateFailed
async def async_register_component(self, binary, async_add_entities):