From 9731e8050c7c770fcac1059356713b8de79e4d6e Mon Sep 17 00:00:00 2001 From: Vincent Wolsink Date: Tue, 17 Sep 2024 09:55:49 +0200 Subject: [PATCH] Only retry on unauthorized or http exception. On all other error codes return empty. --- custom_components/enphase_envoy/envoy_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/enphase_envoy/envoy_reader.py b/custom_components/enphase_envoy/envoy_reader.py index f09f2e6..203cd05 100644 --- a/custom_components/enphase_envoy/envoy_reader.py +++ b/custom_components/enphase_envoy/envoy_reader.py @@ -770,7 +770,7 @@ async def _async_fetch_with_retry(self, url, **kwargs): received_401 += 1 continue _LOGGER.debug("Fetched from %s: %s: %s", url, resp, resp.text) - if resp.status_code == 404: + if resp.status_code != 200: return None return resp except httpx.TransportError as e: