mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Retry solaredge on socket.gaierror (#95153)
This commit is contained in:
parent
5059cee53f
commit
3ea26efac9
@ -1,6 +1,8 @@
|
||||
"""The SolarEdge integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
import socket
|
||||
|
||||
from requests.exceptions import ConnectTimeout, HTTPError
|
||||
from solaredge import Solaredge
|
||||
|
||||
@ -25,7 +27,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
response = await hass.async_add_executor_job(
|
||||
api.get_details, entry.data[CONF_SITE_ID]
|
||||
)
|
||||
except (ConnectTimeout, HTTPError) as ex:
|
||||
except (ConnectTimeout, HTTPError, socket.gaierror) as ex:
|
||||
LOGGER.error("Could not retrieve details from SolarEdge API")
|
||||
raise ConfigEntryNotReady from ex
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user