Increase default timeout to 30 seconds in Synology DSM (#116836)

increase default timeout to 30s and use it consequently
This commit is contained in:
Michael 2024-05-05 15:07:18 +02:00 committed by GitHub
parent 486bb6d89f
commit 3d7d8fa28b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -39,6 +39,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import (
CONF_DEVICE_TOKEN,
DEFAULT_TIMEOUT,
EXCEPTION_DETAILS,
EXCEPTION_UNKNOWN,
SYNOLOGY_CONNECTION_EXCEPTIONS,
@ -118,7 +119,7 @@ class SynoApi:
self._entry.data[CONF_USERNAME],
self._entry.data[CONF_PASSWORD],
self._entry.data[CONF_SSL],
timeout=self._entry.options.get(CONF_TIMEOUT) or 10,
timeout=self._entry.options.get(CONF_TIMEOUT) or DEFAULT_TIMEOUT,
device_token=self._entry.data.get(CONF_DEVICE_TOKEN),
)
await self.async_login()

View File

@ -179,7 +179,9 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
port = DEFAULT_PORT
session = async_get_clientsession(self.hass, verify_ssl)
api = SynologyDSM(session, host, port, username, password, use_ssl, timeout=30)
api = SynologyDSM(
session, host, port, username, password, use_ssl, timeout=DEFAULT_TIMEOUT
)
errors = {}
try:

View File

@ -40,7 +40,7 @@ DEFAULT_PORT = 5000
DEFAULT_PORT_SSL = 5001
# Options
DEFAULT_SCAN_INTERVAL = 15 # min
DEFAULT_TIMEOUT = 10 # sec
DEFAULT_TIMEOUT = 30 # sec
DEFAULT_SNAPSHOT_QUALITY = SNAPSHOT_PROFILE_BALANCED
ENTITY_UNIT_LOAD = "load"