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 ruff suggestions #1516

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bleak/uuids.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import annotations

from typing import Dict
from uuid import UUID


uuid16_dict: Dict[int, str] = {
uuid16_dict: dict[int, str] = {
0x0001: "SDP",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still support Python 3.8 so can't make this change yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also adds from __future__ import annotations

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I guess that prevents runtime errors, but it still technically isn't valid. Since Python 3.8 is reaching end of life later this year, I'm tempted to defer this until then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bleak/__init__.py has from __future__ import annotations

from __future__ import annotations

0x0003: "RFCOMM",
0x0005: "TCS-BIN",
Expand Down Expand Up @@ -1029,7 +1028,7 @@
0xFFFE: "Alliance for Wireless Power (A4WP)",
}

uuid128_dict: Dict[str, str] = {
uuid128_dict: dict[str, str] = {
"a3c87500-8ed3-4bdf-8a39-a01bebede295": "Eddystone Configuration Service",
"a3c87501-8ed3-4bdf-8a39-a01bebede295": "Capabilities",
"a3c87502-8ed3-4bdf-8a39-a01bebede295": "Active Slot",
Expand Down Expand Up @@ -1067,7 +1066,7 @@
"e95d9775-251d-470a-a062-fa1922dfa9a8": "MicroBit Event Data",
"e95d23c4-251d-470a-a062-fa1922dfa9a8": "MicroBit Client Requirements",
"e95d5404-251d-470a-a062-fa1922dfa9a8": "MicroBit Client Events",
"e95d93b0-251d-470a-a062-fa1922dfa9a8": "MicroBit DFU Control Service" "",
"e95d93b0-251d-470a-a062-fa1922dfa9a8": "MicroBit DFU Control Service",
"e95d93b1-251d-470a-a062-fa1922dfa9a8": "MicroBit DFU Control",
"e95d6100-251d-470a-a062-fa1922dfa9a8": "MicroBit Temperature Service",
"e95d1b25-251d-470a-a062-fa1922dfa9a8": "MicroBit Temperature Period",
Expand Down Expand Up @@ -1194,7 +1193,7 @@ def uuidstr_to_str(uuid_):
return s


def register_uuids(uuids_to_descriptions: Dict[str, str]) -> None:
def register_uuids(uuids_to_descriptions: dict[str, str]) -> None:
"""Add or modify the mapping of 128-bit UUIDs for services and characteristics to descriptions.

Args:
Expand Down
Loading