Skip to content

Commit 627561d

Browse files
authored
Update config_flow.py
1 parent eda04ec commit 627561d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

custom_components/switch_port_card_pro/config_flow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
DEFAULT_SYSTEM_OIDS,
2525
CONF_SNMP_PORT,
2626
DEFAULT_SNMP_PORT,
27+
CONF_OID_SYSNAME,
2728
)
2829

2930
_LOGGER = logging.getLogger(__name__)
@@ -76,6 +77,7 @@ async def async_step_user(
7677
data={
7778
CONF_HOST: user_input[CONF_HOST],
7879
CONF_COMMUNITY: user_input[CONF_COMMUNITY],
80+
CONF_SNMP_PORT: user_input[CONF_SNMP_PORT],
7981
},
8082
options={
8183
# CONF_PORTS: DEFAULT_PORTS, # removed for auto port detection
@@ -113,7 +115,7 @@ async def _test_connection(self, hass: HomeAssistant, host: str, community: str,
113115
host,
114116
community,
115117
SNMP_port=161,
116-
"1.3.6.1.2.1.1.5.0", # sysName — more reliable than sysDescr
118+
CONF_OID_SYSNAME, # sysName — more reliable than sysDescr
117119
timeout=12,
118120
retries=3,
119121
mp_model=1, # v2c

0 commit comments

Comments
 (0)