mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 20:55:10 +02:00
Add host field to add_torrent service (#28653)
* Add host field to add_torrent service * Code cleanup * use name instead of host for service * update add_torrent
This commit is contained in:
committed by
Paulus Schoutsen
parent
f8a36499c1
commit
a5960830d7
@@ -16,9 +16,19 @@ from . import get_api
|
||||
from .const import DEFAULT_NAME, DEFAULT_PORT, DEFAULT_SCAN_INTERVAL, DOMAIN
|
||||
from .errors import AuthenticationError, CannotConnect, UnknownError
|
||||
|
||||
DATA_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_NAME, default=DEFAULT_NAME): str,
|
||||
vol.Required(CONF_HOST): str,
|
||||
vol.Optional(CONF_USERNAME): str,
|
||||
vol.Optional(CONF_PASSWORD): str,
|
||||
vol.Required(CONF_PORT, default=DEFAULT_PORT): int,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class TransmissionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a UniFi config flow."""
|
||||
"""Handle Tansmission config flow."""
|
||||
|
||||
VERSION = 1
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
|
||||
@@ -57,17 +67,7 @@ class TransmissionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
)
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_NAME, default=DEFAULT_NAME): str,
|
||||
vol.Required(CONF_HOST): str,
|
||||
vol.Optional(CONF_USERNAME): str,
|
||||
vol.Optional(CONF_PASSWORD): str,
|
||||
vol.Required(CONF_PORT, default=DEFAULT_PORT): int,
|
||||
}
|
||||
),
|
||||
errors=errors,
|
||||
step_id="user", data_schema=DATA_SCHEMA, errors=errors,
|
||||
)
|
||||
|
||||
async def async_step_import(self, import_config):
|
||||
|
Reference in New Issue
Block a user