Fix optional argument in deconz test type definition (#136411)

This commit is contained in:
epenet 2025-01-26 17:42:10 +01:00 committed by GitHub
parent 909af0db82
commit feb65c7e9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,9 +19,14 @@ from tests.common import MockConfigEntry
from tests.components.light.conftest import mock_light_profiles # noqa: F401
from tests.test_util.aiohttp import AiohttpClientMocker
type ConfigEntryFactoryType = Callable[
[MockConfigEntry], Coroutine[Any, Any, MockConfigEntry]
]
class ConfigEntryFactoryType(Protocol):
"""Fixture factory that can set up deCONZ config entry."""
async def __call__(self, entry: MockConfigEntry = ..., /) -> MockConfigEntry:
"""Set up a deCONZ config entry."""
type WebsocketDataType = Callable[[dict[str, Any]], Coroutine[Any, Any, None]]
type WebsocketStateType = Callable[[str], Coroutine[Any, Any, None]]
@ -203,10 +208,10 @@ async def fixture_config_entry_factory(
config_entry: MockConfigEntry,
mock_requests: Callable[[str], None],
) -> ConfigEntryFactoryType:
"""Fixture factory that can set up UniFi network integration."""
"""Fixture factory that can set up deCONZ integration."""
async def __mock_setup_config_entry(
entry: MockConfigEntry = config_entry,
entry: MockConfigEntry = config_entry, /
) -> MockConfigEntry:
entry.add_to_hass(hass)
mock_requests(entry.data[CONF_HOST])