mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Improve exception catching and handling in Overkiz integration (#66604)
This commit is contained in:
parent
c5ae43144d
commit
5568531f74
@ -9,8 +9,10 @@ from pyoverkiz.client import OverkizClient
|
|||||||
from pyoverkiz.enums import EventName, ExecutionState
|
from pyoverkiz.enums import EventName, ExecutionState
|
||||||
from pyoverkiz.exceptions import (
|
from pyoverkiz.exceptions import (
|
||||||
BadCredentialsException,
|
BadCredentialsException,
|
||||||
|
InvalidEventListenerIdException,
|
||||||
MaintenanceException,
|
MaintenanceException,
|
||||||
NotAuthenticatedException,
|
NotAuthenticatedException,
|
||||||
|
TooManyConcurrentRequestsException,
|
||||||
TooManyRequestsException,
|
TooManyRequestsException,
|
||||||
)
|
)
|
||||||
from pyoverkiz.models import Device, Event, Place
|
from pyoverkiz.models import Device, Event, Place
|
||||||
@ -67,10 +69,14 @@ class OverkizDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Device]]):
|
|||||||
events = await self.client.fetch_events()
|
events = await self.client.fetch_events()
|
||||||
except BadCredentialsException as exception:
|
except BadCredentialsException as exception:
|
||||||
raise ConfigEntryAuthFailed("Invalid authentication.") from exception
|
raise ConfigEntryAuthFailed("Invalid authentication.") from exception
|
||||||
|
except TooManyConcurrentRequestsException as exception:
|
||||||
|
raise UpdateFailed("Too many concurrent requests.") from exception
|
||||||
except TooManyRequestsException as exception:
|
except TooManyRequestsException as exception:
|
||||||
raise UpdateFailed("Too many requests, try again later.") from exception
|
raise UpdateFailed("Too many requests, try again later.") from exception
|
||||||
except MaintenanceException as exception:
|
except MaintenanceException as exception:
|
||||||
raise UpdateFailed("Server is down for maintenance.") from exception
|
raise UpdateFailed("Server is down for maintenance.") from exception
|
||||||
|
except InvalidEventListenerIdException as exception:
|
||||||
|
raise UpdateFailed(exception) from exception
|
||||||
except TimeoutError as exception:
|
except TimeoutError as exception:
|
||||||
raise UpdateFailed("Failed to connect.") from exception
|
raise UpdateFailed("Failed to connect.") from exception
|
||||||
except (ServerDisconnectedError, NotAuthenticatedException):
|
except (ServerDisconnectedError, NotAuthenticatedException):
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/overkiz",
|
"documentation": "https://www.home-assistant.io/integrations/overkiz",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pyoverkiz==1.3.4"
|
"pyoverkiz==1.3.5"
|
||||||
],
|
],
|
||||||
"zeroconf": [
|
"zeroconf": [
|
||||||
{
|
{
|
||||||
|
@ -1749,7 +1749,7 @@ pyotgw==1.1b1
|
|||||||
pyotp==2.6.0
|
pyotp==2.6.0
|
||||||
|
|
||||||
# homeassistant.components.overkiz
|
# homeassistant.components.overkiz
|
||||||
pyoverkiz==1.3.4
|
pyoverkiz==1.3.5
|
||||||
|
|
||||||
# homeassistant.components.openweathermap
|
# homeassistant.components.openweathermap
|
||||||
pyowm==3.2.0
|
pyowm==3.2.0
|
||||||
|
@ -1118,7 +1118,7 @@ pyotgw==1.1b1
|
|||||||
pyotp==2.6.0
|
pyotp==2.6.0
|
||||||
|
|
||||||
# homeassistant.components.overkiz
|
# homeassistant.components.overkiz
|
||||||
pyoverkiz==1.3.4
|
pyoverkiz==1.3.5
|
||||||
|
|
||||||
# homeassistant.components.openweathermap
|
# homeassistant.components.openweathermap
|
||||||
pyowm==3.2.0
|
pyowm==3.2.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user