mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 05:47:10 +00:00
Increase timeout for coolmaster with swing (#87573)
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
parent
2cb673db04
commit
cbee1ba496
@ -21,8 +21,20 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
"""Set up Coolmaster from a config entry."""
|
"""Set up Coolmaster from a config entry."""
|
||||||
host = entry.data[CONF_HOST]
|
host = entry.data[CONF_HOST]
|
||||||
port = entry.data[CONF_PORT]
|
port = entry.data[CONF_PORT]
|
||||||
|
if not entry.data.get(CONF_SWING_SUPPORT):
|
||||||
coolmaster = CoolMasterNet(
|
coolmaster = CoolMasterNet(
|
||||||
host, port, swing_support=entry.data.get(CONF_SWING_SUPPORT, False)
|
host,
|
||||||
|
port,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# Swing support adds an additional request per unit. The requests are
|
||||||
|
# done in parallel, which can cause delays on the server. Therefore,
|
||||||
|
# we increase the request timeout to 5 seconds instead of 1.
|
||||||
|
coolmaster = CoolMasterNet(
|
||||||
|
host,
|
||||||
|
port,
|
||||||
|
read_timeout=5,
|
||||||
|
swing_support=True,
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
info = await coolmaster.info()
|
info = await coolmaster.info()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user