Skip to content

Commit

Permalink
Only retry on unauthorized or http exception. On all other error code…
Browse files Browse the repository at this point in the history
…s return empty.
  • Loading branch information
vincentwolsink committed Sep 17, 2024
1 parent 8c5f4a1 commit 9731e80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/enphase_envoy/envoy_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9731e80

Please sign in to comment.