From fd11ad4d0d35798ef3b8e2ae775f40f18a5b94aa Mon Sep 17 00:00:00 2001 From: drc38 <20024196+drc38@users.noreply.github.com> Date: Sat, 30 Nov 2024 21:17:05 +1300 Subject: [PATCH] add retry to agg data v2 --- fronius_solarweb/api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fronius_solarweb/api.py b/fronius_solarweb/api.py index 35f8b9d..e4a4909 100644 --- a/fronius_solarweb/api.py +++ b/fronius_solarweb/api.py @@ -190,6 +190,13 @@ async def get_system_flow_data(self, tz: str = "zulu") -> PvSystemFlowData: _LOGGER.error(e) return model_data + @retry( + wait=wait_random_exponential(multiplier=2, max=60), + retry=retry_if_not_exception_type( + (ValidationError, NotAuthorizedException, NotFoundException) + ), + stop=stop_after_attempt(MAX_ATTEMPTS), + ) async def get_system_aggr_data_v2( self, period: str = "total", channels: List[str] | None = None ) -> PvSystemAggrDataV2: