mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Add parallel updates & exception translations to tedee (#131146)
This commit is contained in:
parent
e2183a81aa
commit
60e19967b1
@ -99,14 +99,19 @@ class TedeeApiCoordinator(DataUpdateCoordinator[dict[int, TedeeLock]]):
|
||||
await update_fn()
|
||||
except TedeeLocalAuthException as ex:
|
||||
raise ConfigEntryAuthFailed(
|
||||
"Authentication failed. Local access token is invalid"
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="authentification_failed",
|
||||
) from ex
|
||||
|
||||
except TedeeDataUpdateException as ex:
|
||||
_LOGGER.debug("Error while updating data: %s", str(ex))
|
||||
raise UpdateFailed(f"Error while updating data: {ex!s}") from ex
|
||||
raise UpdateFailed(
|
||||
translation_domain=DOMAIN, translation_key="update_failed"
|
||||
) from ex
|
||||
except (TedeeClientException, TimeoutError) as ex:
|
||||
raise UpdateFailed(f"Querying API failed. Error: {ex!s}") from ex
|
||||
raise UpdateFailed(
|
||||
translation_domain=DOMAIN, translation_key="api_error"
|
||||
) from ex
|
||||
|
||||
def webhook_received(self, message: dict[str, Any]) -> None:
|
||||
"""Handle webhook message."""
|
||||
|
@ -13,6 +13,8 @@ from .const import DOMAIN
|
||||
from .coordinator import TedeeApiCoordinator, TedeeConfigEntry
|
||||
from .entity import TedeeEntity
|
||||
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
|
@ -66,12 +66,21 @@
|
||||
}
|
||||
},
|
||||
"exceptions": {
|
||||
"api_error": {
|
||||
"message": "Error while communicating with the API"
|
||||
},
|
||||
"authentication_failed": {
|
||||
"message": "Authentication failed. Local access token is invalid"
|
||||
},
|
||||
"lock_failed": {
|
||||
"message": "Failed to lock the door. Lock {lock_id}"
|
||||
},
|
||||
"unlock_failed": {
|
||||
"message": "Failed to unlock the door. Lock {lock_id}"
|
||||
},
|
||||
"update_failed": {
|
||||
"message": "Error while updating data"
|
||||
},
|
||||
"open_failed": {
|
||||
"message": "Failed to unlatch the door. Lock {lock_id}"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user