Elmax -Handle 422 busy error with a retry approach (#91926)

This commit is contained in:
Alberto Geniola 2023-04-24 18:51:40 +02:00 committed by GitHub
parent e2d2aeadaa
commit f104bba683
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View file

@ -11,6 +11,7 @@ from elmax_api.exceptions import (
ElmaxBadLoginError,
ElmaxBadPinError,
ElmaxNetworkError,
ElmaxPanelBusyError,
)
from elmax_api.http import Elmax
from elmax_api.model.actuator import Actuator
@ -124,6 +125,10 @@ class ElmaxCoordinator(DataUpdateCoordinator[PanelStatus]):
raise ConfigEntryAuthFailed("Refused username/password") from err
except ElmaxApiError as err:
raise UpdateFailed(f"Error communicating with ELMAX API: {err}") from err
except ElmaxPanelBusyError as err:
raise UpdateFailed(
"Communication with the panel failed, as it is currently busy"
) from err
except ElmaxNetworkError as err:
raise UpdateFailed(
"A network error occurred while communicating with Elmax cloud."