mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 12:30:31 +00:00
Update error handling in update coordinator (#32452)
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
"""Support for the Philips Hue sensors as a platform."""
|
||||
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,9 +58,9 @@ class SensorManager:
|
||||
)
|
||||
except Unauthorized:
|
||||
await self.bridge.handle_unauthorized_error()
|
||||
raise UpdateFailed
|
||||
except (asyncio.TimeoutError, AiohueException, client_exceptions.ClientError):
|
||||
raise UpdateFailed
|
||||
raise UpdateFailed("Unauthorized")
|
||||
except AiohueException as err:
|
||||
raise UpdateFailed(f"Hue error: {err}")
|
||||
|
||||
async def async_register_component(self, binary, async_add_entities):
|
||||
"""Register async_add_entities methods for components."""
|
||||
|
||||
Reference in New Issue
Block a user