mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Increase default timeout to 30 seconds in Synology DSM (#116836)
increase default timeout to 30s and use it consequently
This commit is contained in:
parent
486bb6d89f
commit
3d7d8fa28b
@ -39,6 +39,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
|||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_DEVICE_TOKEN,
|
CONF_DEVICE_TOKEN,
|
||||||
|
DEFAULT_TIMEOUT,
|
||||||
EXCEPTION_DETAILS,
|
EXCEPTION_DETAILS,
|
||||||
EXCEPTION_UNKNOWN,
|
EXCEPTION_UNKNOWN,
|
||||||
SYNOLOGY_CONNECTION_EXCEPTIONS,
|
SYNOLOGY_CONNECTION_EXCEPTIONS,
|
||||||
@ -118,7 +119,7 @@ class SynoApi:
|
|||||||
self._entry.data[CONF_USERNAME],
|
self._entry.data[CONF_USERNAME],
|
||||||
self._entry.data[CONF_PASSWORD],
|
self._entry.data[CONF_PASSWORD],
|
||||||
self._entry.data[CONF_SSL],
|
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),
|
device_token=self._entry.data.get(CONF_DEVICE_TOKEN),
|
||||||
)
|
)
|
||||||
await self.async_login()
|
await self.async_login()
|
||||||
|
@ -179,7 +179,9 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
port = DEFAULT_PORT
|
port = DEFAULT_PORT
|
||||||
|
|
||||||
session = async_get_clientsession(self.hass, verify_ssl)
|
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 = {}
|
errors = {}
|
||||||
try:
|
try:
|
||||||
|
@ -40,7 +40,7 @@ DEFAULT_PORT = 5000
|
|||||||
DEFAULT_PORT_SSL = 5001
|
DEFAULT_PORT_SSL = 5001
|
||||||
# Options
|
# Options
|
||||||
DEFAULT_SCAN_INTERVAL = 15 # min
|
DEFAULT_SCAN_INTERVAL = 15 # min
|
||||||
DEFAULT_TIMEOUT = 10 # sec
|
DEFAULT_TIMEOUT = 30 # sec
|
||||||
DEFAULT_SNAPSHOT_QUALITY = SNAPSHOT_PROFILE_BALANCED
|
DEFAULT_SNAPSHOT_QUALITY = SNAPSHOT_PROFILE_BALANCED
|
||||||
|
|
||||||
ENTITY_UNIT_LOAD = "load"
|
ENTITY_UNIT_LOAD = "load"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user