Adjust async_step_zeroconf signature for strict typing (#59503)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
5cc594682f
commit
b3ffc1e183
26 changed files with 85 additions and 66 deletions
|
@ -8,7 +8,7 @@ from enum import Enum
|
|||
import functools
|
||||
import logging
|
||||
from types import MappingProxyType, MethodType
|
||||
from typing import Any, Callable, Optional, cast
|
||||
from typing import TYPE_CHECKING, Any, Callable, Optional, cast
|
||||
import weakref
|
||||
|
||||
from homeassistant import data_entry_flow, loader
|
||||
|
@ -31,6 +31,9 @@ from homeassistant.setup import async_process_deps_reqs, async_setup_component
|
|||
from homeassistant.util.decorator import Registry
|
||||
import homeassistant.util.uuid as uuid_util
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from homeassistant.components.zeroconf import ZeroconfServiceInfo
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SOURCE_DISCOVERY = "discovery"
|
||||
|
@ -1369,10 +1372,10 @@ class ConfigFlow(data_entry_flow.FlowHandler):
|
|||
return await self.async_step_discovery(discovery_info)
|
||||
|
||||
async def async_step_zeroconf(
|
||||
self, discovery_info: DiscoveryInfoType
|
||||
self, discovery_info: ZeroconfServiceInfo
|
||||
) -> data_entry_flow.FlowResult:
|
||||
"""Handle a flow initialized by Zeroconf discovery."""
|
||||
return await self.async_step_discovery(discovery_info)
|
||||
return await self.async_step_discovery(cast(dict, discovery_info))
|
||||
|
||||
async def async_step_dhcp(
|
||||
self, discovery_info: DiscoveryInfoType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue