Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect mypy diagnosis of Unpack[ExtraArgs]. #1488

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

JPHutchins
Copy link
Contributor

Fixes #1487 in the simplest way, according to https://peps.python.org/pep-0692/#required-and-non-required-keys. This has the effect of making the BleakScanner ExtraArgs optional instead of required.

For reference:

    class ExtraArgs(TypedDict):
        """
        Keyword args from :class:`~bleak.BleakScanner` that can be passed to
        other convenience methods.
        """

        service_uuids: List[str]
        """
        Optional list of service UUIDs to filter on. Only advertisements
        containing this advertising data will be received. Required on
        macOS >= 12.0, < 12.3 (unless you create an app with ``py2app``).
        """
        scanning_mode: Literal["active", "passive"]
        """
        Set to ``"passive"`` to avoid the ``"active"`` scanning mode.
        Passive scanning is not supported on macOS! Will raise
        :class:`BleakError` if set to ``"passive"`` on macOS.
        """
        bluez: BlueZScannerArgs
        """
        Dictionary of arguments specific to the BlueZ backend.
        """
        cb: CBScannerArgs
        """
        Dictionary of arguments specific to the CoreBluetooth backend.
        """
        backend: Type[BaseBleakScanner]
        """
        Used to override the automatically selected backend (i.e. for a
            custom backend).
        """

@dlech dlech merged commit 17d4374 into hbldh:develop Dec 30, 2023
13 checks passed
@dlech
Copy link
Collaborator

dlech commented Dec 30, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mypy / error: Missing named argument ... [call-arg] / for optional kwargs
2 participants