Add transmission-integration path and protocol (#104334)

This updates the config_flow migration from v1.1 to v1.2
including migration tests
This commit is contained in:
Ingmar Delsink
2024-03-21 11:05:36 +01:00
committed by GitHub
parent ff6812a798
commit 67a14d0463
7 changed files with 99 additions and 10 deletions

View File

@ -13,7 +13,14 @@ from homeassistant.config_entries import (
ConfigFlowResult,
OptionsFlow,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PATH,
CONF_PORT,
CONF_SSL,
CONF_USERNAME,
)
from homeassistant.core import callback
from . import get_api
@ -23,7 +30,9 @@ from .const import (
DEFAULT_LIMIT,
DEFAULT_NAME,
DEFAULT_ORDER,
DEFAULT_PATH,
DEFAULT_PORT,
DEFAULT_SSL,
DOMAIN,
SUPPORTED_ORDER_MODES,
)
@ -31,7 +40,9 @@ from .errors import AuthenticationError, CannotConnect, UnknownError
DATA_SCHEMA = vol.Schema(
{
vol.Optional(CONF_SSL, default=DEFAULT_SSL): bool,
vol.Required(CONF_HOST): str,
vol.Required(CONF_PATH, default=DEFAULT_PATH): str,
vol.Optional(CONF_USERNAME): str,
vol.Optional(CONF_PASSWORD): str,
vol.Required(CONF_PORT, default=DEFAULT_PORT): int,
@ -43,6 +54,7 @@ class TransmissionFlowHandler(ConfigFlow, domain=DOMAIN):
"""Handle Tansmission config flow."""
VERSION = 1
MINOR_VERSION = 2
_reauth_entry: ConfigEntry | None
@staticmethod