Change default timeout for operations in SNMP component (#68230)
This commit is contained in:
parent
aabfa08834
commit
fc693001a1
2 changed files with 4 additions and 2 deletions
|
@ -16,6 +16,7 @@ DEFAULT_HOST = "localhost"
|
|||
DEFAULT_NAME = "SNMP"
|
||||
DEFAULT_PORT = "161"
|
||||
DEFAULT_PRIV_PROTOCOL = "none"
|
||||
DEFAULT_TIMEOUT = 8
|
||||
DEFAULT_VERSION = "1"
|
||||
DEFAULT_VARTYPE = "none"
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ from .const import (
|
|||
DEFAULT_NAME,
|
||||
DEFAULT_PORT,
|
||||
DEFAULT_PRIV_PROTOCOL,
|
||||
DEFAULT_TIMEOUT,
|
||||
DEFAULT_VERSION,
|
||||
MAP_AUTH_PROTOCOLS,
|
||||
MAP_PRIV_PROTOCOLS,
|
||||
|
@ -125,14 +126,14 @@ async def async_setup_platform(
|
|||
authProtocol=getattr(hlapi, MAP_AUTH_PROTOCOLS[authproto]),
|
||||
privProtocol=getattr(hlapi, MAP_PRIV_PROTOCOLS[privproto]),
|
||||
),
|
||||
UdpTransportTarget((host, port)),
|
||||
UdpTransportTarget((host, port), timeout=DEFAULT_TIMEOUT),
|
||||
ContextData(),
|
||||
]
|
||||
else:
|
||||
request_args = [
|
||||
SnmpEngine(),
|
||||
CommunityData(community, mpModel=SNMP_VERSIONS[version]),
|
||||
UdpTransportTarget((host, port)),
|
||||
UdpTransportTarget((host, port), timeout=DEFAULT_TIMEOUT),
|
||||
ContextData(),
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue