from . import async_discover_devices as async_discover_devices, create_async_tplink_clientsession as create_async_tplink_clientsession, get_credentials as get_credentials, mac_alias as mac_alias, set_credentials as set_credentials
from .const import CONF_AES_KEYS as CONF_AES_KEYS, CONF_CAMERA_CREDENTIALS as CONF_CAMERA_CREDENTIALS, CONF_CONFIG_ENTRY_MINOR_VERSION as CONF_CONFIG_ENTRY_MINOR_VERSION, CONF_CONNECTION_PARAMETERS as CONF_CONNECTION_PARAMETERS, CONF_CREDENTIALS_HASH as CONF_CREDENTIALS_HASH, CONF_LIVE_VIEW as CONF_LIVE_VIEW, CONF_USES_HTTP as CONF_USES_HTTP, CONNECT_TIMEOUT as CONNECT_TIMEOUT, DOMAIN as DOMAIN
from _typeshed import Incomplete
from collections.abc import Mapping
from homeassistant.components import ffmpeg as ffmpeg, stream as stream
from homeassistant.config_entries import ConfigEntry as ConfigEntry, ConfigEntryState as ConfigEntryState, ConfigFlow as ConfigFlow, ConfigFlowResult as ConfigFlowResult, SOURCE_REAUTH as SOURCE_REAUTH, SOURCE_RECONFIGURE as SOURCE_RECONFIGURE
from homeassistant.const import CONF_ALIAS as CONF_ALIAS, CONF_DEVICE as CONF_DEVICE, CONF_HOST as CONF_HOST, CONF_MAC as CONF_MAC, CONF_MODEL as CONF_MODEL, CONF_NAME as CONF_NAME, CONF_PASSWORD as CONF_PASSWORD, CONF_PORT as CONF_PORT, CONF_USERNAME as CONF_USERNAME
from homeassistant.core import callback as callback
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo as DhcpServiceInfo
from homeassistant.helpers.typing import DiscoveryInfoType as DiscoveryInfoType
from kasa import Credentials, Device
from typing import Any, Self

_LOGGER: Incomplete
STEP_AUTH_DATA_SCHEMA: Incomplete
STEP_RECONFIGURE_DATA_SCHEMA: Incomplete
STEP_CAMERA_AUTH_DATA_SCHEMA: Incomplete

class TPLinkConfigFlow(ConfigFlow, domain=DOMAIN):
    VERSION: int
    MINOR_VERSION = CONF_CONFIG_ENTRY_MINOR_VERSION
    host: str | None
    port: int | None
    _discovered_devices: dict[str, Device]
    _discovered_device: Device | None
    def __init__(self) -> None: ...
    async def async_step_dhcp(self, discovery_info: DhcpServiceInfo) -> ConfigFlowResult: ...
    async def async_step_integration_discovery(self, discovery_info: DiscoveryInfoType) -> ConfigFlowResult: ...
    @callback
    def _get_config_updates(self, entry: ConfigEntry, host: str, device: Device | None) -> dict | None: ...
    @callback
    def _update_config_if_entry_in_setup_error(self, entry: ConfigEntry, host: str, device: Device | None) -> ConfigFlowResult | None: ...
    async def _async_handle_discovery(self, host: str, formatted_mac: str, device: Device | None = None) -> ConfigFlowResult: ...
    def is_matching(self, other_flow: Self) -> bool: ...
    async def async_step_discovery_auth_confirm(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    def _async_make_placeholders_from_discovery(self) -> dict[str, str]: ...
    async def async_step_discovery_confirm(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    @staticmethod
    def _async_get_host_port(host_str: str) -> tuple[str, int | None]: ...
    def _async_supports_camera_credentials(self, device: Device) -> bool: ...
    async def async_step_user(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    async def async_step_user_auth_confirm(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    def _create_camera_entry(self, device: Device, un: str, pw: str) -> ConfigFlowResult: ...
    async def async_step_camera_auth_confirm(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    async def async_step_pick_device(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    async def _async_reload_requires_auth_entries(self) -> None: ...
    @callback
    def _async_create_or_update_entry_from_device(self, device: Device, *, camera_data: dict | None = None) -> ConfigFlowResult: ...
    async def _async_try_connect_all(self, host: str, credentials: Credentials | None, raise_on_progress: bool, *, port: int | None = None) -> Device | None: ...
    async def _async_try_discover_and_update(self, host: str, credentials: Credentials | None, raise_on_progress: bool, raise_on_timeout: bool, *, port: int | None = None) -> Device | None: ...
    async def _async_try_connect(self, discovered_device: Device, credentials: Credentials | None) -> Device: ...
    async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> ConfigFlowResult: ...
    async def async_step_reauth_confirm(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
    async def async_step_reconfigure(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult: ...
