Skip to content

Commit

Permalink
Elmax -Handle 422 busy error with a retry approach (home-assistant#91926
Browse files Browse the repository at this point in the history
)
  • Loading branch information
albertogeniola authored Apr 24, 2023
1 parent e2d2aea commit f104bba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions homeassistant/components/elmax/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ElmaxBadLoginError,
ElmaxBadPinError,
ElmaxNetworkError,
ElmaxPanelBusyError,
)
from elmax_api.http import Elmax
from elmax_api.model.actuator import Actuator
Expand Down Expand Up @@ -124,6 +125,10 @@ async def _async_update_data(self):
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."
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/elmax/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/elmax",
"iot_class": "cloud_polling",
"loggers": ["elmax_api"],
"requirements": ["elmax_api==0.0.2"]
"requirements": ["elmax_api==0.0.4"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ eliqonline==1.2.2
elkm1-lib==2.2.1

# homeassistant.components.elmax
elmax_api==0.0.2
elmax_api==0.0.4

# homeassistant.components.emulated_roku
emulated_roku==0.2.1
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ elgato==4.0.1
elkm1-lib==2.2.1

# homeassistant.components.elmax
elmax_api==0.0.2
elmax_api==0.0.4

# homeassistant.components.emulated_roku
emulated_roku==0.2.1
Expand Down

0 comments on commit f104bba

Please sign in to comment.