Skip to content

Commit

Permalink
Bump version to 1.5.3
Browse files Browse the repository at this point in the history
Blacked all files
  • Loading branch information
PatrickBaus committed Jun 22, 2024
1 parent 48cd856 commit 0ffb426
Show file tree
Hide file tree
Showing 31 changed files with 42 additions and 14 deletions.
8 changes: 4 additions & 4 deletions examples/brick_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ async def run_master_extension_wifi(brick: BrickMaster) -> None:
# The mac and bssid are stored as tuples of int. We will replace them with the more common hex notation for
# better readability, then we will recreate the named tuple.
new_status["mac_address"] = []
new_status[
"mac_address"
] = "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( # pylint: disable=consider-using-f-string
*new_status["mac_address"]
new_status["mac_address"] = (
"{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( # pylint: disable=consider-using-f-string
*new_status["mac_address"]
)
)
new_status["bssid"] = "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( # pylint: disable=consider-using-f-string
*new_status["bssid"]
Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
([original Python bindings](https://www.tinkerforge.com/en/doc/Software/API_Bindings_Python.html)) using Python 3
asyncio.
"""

from ._version import __version__
from .device_factory import device_factory
from .ip_connection import IPConnectionAsync
Expand Down
2 changes: 1 addition & 1 deletion tinkerforge_async/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# pylint: disable=missing-module-docstring
__version__ = "1.5.2"
__version__ = "1.5.3"
1 change: 1 addition & 0 deletions tinkerforge_async/async_event_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
A lightweight event bus for the asyncio framework, that relies on asynchronous
generators to deliver messages.
"""

import asyncio
from typing import Any, AsyncGenerator

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/brick_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python AsyncIO. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=too-many-lines
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_ambient_light_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Ambient_Light_V2.html) implemented using Python asyncio. It does
the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_ambient_light_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Ambient_Light_V3.html) implemented using Python asyncio. It does
the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_analog_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python asyncio. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_barometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python AsyncIO. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_barometer_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Barometer_V2.html) implemented using Python asyncio. It does the
low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_humidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python AsyncIO. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_humidity_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Humidity_V2.html) implemented using Python asyncIO. It does the
low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_industrial_dual_analog_in_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
asyncio. It does the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units
to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_industrial_ptc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
implemented using Python asyncIO. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

from .bricklet_ptc_v2 import BrickletPtcV2
from .devices import DeviceIdentifier

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_io16.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python asyncio. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_io4_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python asyncio. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_isolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Isolator.html) implemented using Python asyncio. It does
the low-level communication with the Tinkerforge ip connection.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_moisture.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python asyncio. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_motion_detector_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Barometer_V2.html) implemented using Python asyncio. It does the
low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_ptc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Python asyncIO. It does the low-level communication with the Tinkerforge ip connection and also handles conversion
of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_ptc_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python asyncio. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_rs232_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Python asyncIO. It does the low-level communication with the Tinkerforge ip connection and also handles conversion
of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_segment_display_4x7.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
does the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI
units.
"""

from __future__ import annotations

from enum import Enum, unique
Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_segment_display_4x7_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
does the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI
units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
implemented using Python asyncIO. It does the low-level communication with the Tinkerforge ip connection and also
handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_temperature_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Temperature_V2.html) implemented using Python asyncio. It does
the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/bricklet_thermocouple_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Thermocouple_V2.html) implemented using Python asyncio. It does
the low-level communication with the Tinkerforge ip connection and also handles conversion of raw units to SI units.
"""

# pylint: disable=duplicate-code # Many sensors of different generations have a similar API
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/device_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
The device factory which allows to create instances of Bricks and Bricklets from
their device id
"""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/devices.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This file contains all base classes used by Bricks and bricklets
"""

from __future__ import annotations

import time
Expand Down
18 changes: 9 additions & 9 deletions tinkerforge_async/ip_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module implements the underlying ip connection to the Bricks and Bricklets.
See https://www.tinkerforge.com/de/doc/Low_Level_Protocols/TCPIP.html for details.
"""

from __future__ import annotations

import asyncio
Expand Down Expand Up @@ -296,9 +297,11 @@ def __parse_enumerate_payload(payload) -> EnumerationPayload:
# We will return None for all 'invalid' fields instead of garbage like the Tinkerforge API
return EnumerationPayload(
base58decode(uid),
None
if (enumeration_type is EnumerationType.DISCONNECTED or connected_uid == "0")
else base58decode(connected_uid),
(
None
if (enumeration_type is EnumerationType.DISCONNECTED or connected_uid == "0")
else base58decode(connected_uid)
),
None if enumeration_type is EnumerationType.DISCONNECTED else position,
None if enumeration_type is EnumerationType.DISCONNECTED else hardware_version,
None if enumeration_type is EnumerationType.DISCONNECTED else firmware_version,
Expand Down Expand Up @@ -340,8 +343,7 @@ async def send_request(
data: bytes = b"",
*,
response_expected: Literal[True],
) -> tuple[HeaderPayload, bytes]:
...
) -> tuple[HeaderPayload, bytes]: ...

@overload
async def send_request(
Expand All @@ -351,8 +353,7 @@ async def send_request(
data: bytes = b"",
*,
response_expected: Literal[False] = ...,
) -> None:
...
) -> None: ...

@overload
async def send_request(
Expand All @@ -362,8 +363,7 @@ async def send_request(
data: bytes = b"",
*,
response_expected: bool = ...,
) -> tuple[HeaderPayload, bytes] | None:
...
) -> tuple[HeaderPayload, bytes] | None: ...

async def send_request(
self,
Expand Down
1 change: 1 addition & 0 deletions tinkerforge_async/ip_connection_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Some helper functions to encode and decode Tinkerforge protocol payloads.
"""

from __future__ import annotations

import math
Expand Down

0 comments on commit 0ffb426

Please sign in to comment.