mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +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()
|
await update_fn()
|
||||||
except TedeeLocalAuthException as ex:
|
except TedeeLocalAuthException as ex:
|
||||||
raise ConfigEntryAuthFailed(
|
raise ConfigEntryAuthFailed(
|
||||||
"Authentication failed. Local access token is invalid"
|
translation_domain=DOMAIN,
|
||||||
|
translation_key="authentification_failed",
|
||||||
) from ex
|
) from ex
|
||||||
|
|
||||||
except TedeeDataUpdateException as ex:
|
except TedeeDataUpdateException as ex:
|
||||||
_LOGGER.debug("Error while updating data: %s", str(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:
|
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:
|
def webhook_received(self, message: dict[str, Any]) -> None:
|
||||||
"""Handle webhook message."""
|
"""Handle webhook message."""
|
||||||
|
@ -13,6 +13,8 @@ from .const import DOMAIN
|
|||||||
from .coordinator import TedeeApiCoordinator, TedeeConfigEntry
|
from .coordinator import TedeeApiCoordinator, TedeeConfigEntry
|
||||||
from .entity import TedeeEntity
|
from .entity import TedeeEntity
|
||||||
|
|
||||||
|
PARALLEL_UPDATES = 1
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
@ -66,12 +66,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exceptions": {
|
"exceptions": {
|
||||||
|
"api_error": {
|
||||||
|
"message": "Error while communicating with the API"
|
||||||
|
},
|
||||||
|
"authentication_failed": {
|
||||||
|
"message": "Authentication failed. Local access token is invalid"
|
||||||
|
},
|
||||||
"lock_failed": {
|
"lock_failed": {
|
||||||
"message": "Failed to lock the door. Lock {lock_id}"
|
"message": "Failed to lock the door. Lock {lock_id}"
|
||||||
},
|
},
|
||||||
"unlock_failed": {
|
"unlock_failed": {
|
||||||
"message": "Failed to unlock the door. Lock {lock_id}"
|
"message": "Failed to unlock the door. Lock {lock_id}"
|
||||||
},
|
},
|
||||||
|
"update_failed": {
|
||||||
|
"message": "Error while updating data"
|
||||||
|
},
|
||||||
"open_failed": {
|
"open_failed": {
|
||||||
"message": "Failed to unlatch the door. Lock {lock_id}"
|
"message": "Failed to unlatch the door. Lock {lock_id}"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user