mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Remove unused variable and import in NUT (#143294)
Remove unused variable in validate_input
This commit is contained in:
parent
e02c200775
commit
b4344a8de2
@ -19,7 +19,6 @@ from homeassistant.const import (
|
|||||||
CONF_PORT,
|
CONF_PORT,
|
||||||
CONF_USERNAME,
|
CONF_USERNAME,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
|
||||||
from homeassistant.data_entry_flow import AbortFlow
|
from homeassistant.data_entry_flow import AbortFlow
|
||||||
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
|
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ def _ups_schema(ups_list: dict[str, str]) -> vol.Schema:
|
|||||||
return vol.Schema({vol.Required(CONF_ALIAS): vol.In(ups_list)})
|
return vol.Schema({vol.Required(CONF_ALIAS): vol.In(ups_list)})
|
||||||
|
|
||||||
|
|
||||||
async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]:
|
async def validate_input(data: dict[str, Any]) -> dict[str, Any]:
|
||||||
"""Validate the user input allows us to connect.
|
"""Validate the user input allows us to connect.
|
||||||
|
|
||||||
Data has the keys from _base_schema with values provided by the user.
|
Data has the keys from _base_schema with values provided by the user.
|
||||||
@ -303,7 +302,7 @@ class NutConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
info: dict[str, Any] = {}
|
info: dict[str, Any] = {}
|
||||||
description_placeholders: dict[str, str] = {}
|
description_placeholders: dict[str, str] = {}
|
||||||
try:
|
try:
|
||||||
info = await validate_input(self.hass, config)
|
info = await validate_input(config)
|
||||||
except NUTLoginError:
|
except NUTLoginError:
|
||||||
errors[CONF_PASSWORD] = "invalid_auth"
|
errors[CONF_PASSWORD] = "invalid_auth"
|
||||||
except NUTError as ex:
|
except NUTError as ex:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user