Browse Source

Switch to using close_stale_connections_by_address (#224)

J. Nick Koston 3 months ago
parent
commit
0cf7a539fd
4 changed files with 9 additions and 4 deletions
  1. 1 1
      .github/workflows/ci.yaml
  2. 1 1
      requirements_dev.txt
  3. 1 1
      setup.py
  4. 6 1
      switchbot/__init__.py

+ 1 - 1
.github/workflows/ci.yaml

@@ -10,7 +10,7 @@ jobs:
 
     strategy:
       matrix:
-        python-version: [3.9, "3.10", "3.11"]
+        python-version: ["3.10", "3.11", "3.12"]
 
     steps:
     - uses: actions/checkout@v3

+ 1 - 1
requirements_dev.txt

@@ -2,7 +2,7 @@ pytest-asyncio
 pytest-cov
 async_timeout>=4.0.1
 bleak>=0.17.0
-bleak-retry-connector>=2.9.0
+bleak-retry-connector>=3.4.0
 cryptography>=38.0.3
 boto3>=1.20.24
 requests>=2.28.1

+ 1 - 1
setup.py

@@ -6,7 +6,7 @@ setup(
     install_requires=[
         "async_timeout>=4.0.1",
         "bleak>=0.19.0",
-        "bleak-retry-connector>=2.9.0",
+        "bleak-retry-connector>=3.4.0",
         "cryptography>=39.0.0",
         "pyOpenSSL>=23.0.0",
         "boto3>=1.20.24",

+ 6 - 1
switchbot/__init__.py

@@ -1,7 +1,11 @@
 """Library to handle connection with Switchbot."""
 from __future__ import annotations
 
-from bleak_retry_connector import close_stale_connections, get_device
+from bleak_retry_connector import (
+    close_stale_connections,
+    close_stale_connections_by_address,
+    get_device,
+)
 
 from .adv_parser import SwitchbotSupportedType, parse_advertisement_data
 from .const import (
@@ -27,6 +31,7 @@ from .models import SwitchBotAdvertisement
 __all__ = [
     "get_device",
     "close_stale_connections",
+    "close_stale_connections_by_address",
     "parse_advertisement_data",
     "GetSwitchbotDevices",
     "SwitchBotAdvertisement",