From 444fa7e26339de16e46919ebae4278d36a645bec Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 6 Jun 2024 23:59:19 +0200 Subject: [PATCH] python312Packages.bthome-ble: fix habluetooth 3.0 compat --- .../python-modules/bthome-ble/default.nix | 4 ++ .../bthome-ble/habluetooth-3.0-compat.patch | 48 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/bthome-ble/habluetooth-3.0-compat.patch diff --git a/pkgs/development/python-modules/bthome-ble/default.nix b/pkgs/development/python-modules/bthome-ble/default.nix index fc4ac4b9fde0..97020e27a997 100644 --- a/pkgs/development/python-modules/bthome-ble/default.nix +++ b/pkgs/development/python-modules/bthome-ble/default.nix @@ -26,6 +26,10 @@ buildPythonPackage rec { hash = "sha256-v3SzzbdWRJISuF1THHlrvci4b+H1Zw/0e5iSEB0Scvw="; }; + patches = [ + ./habluetooth-3.0-compat.patch + ]; + postPatch = '' substituteInPlace pyproject.toml \ --replace-fail " --cov=bthome_ble --cov-report=term-missing:skip-covered" "" diff --git a/pkgs/development/python-modules/bthome-ble/habluetooth-3.0-compat.patch b/pkgs/development/python-modules/bthome-ble/habluetooth-3.0-compat.patch new file mode 100644 index 000000000000..5e31475dd9dc --- /dev/null +++ b/pkgs/development/python-modules/bthome-ble/habluetooth-3.0-compat.patch @@ -0,0 +1,48 @@ +diff --git a/tests/test_parser_v1.py b/tests/test_parser_v1.py +index d717263..bb03d80 100644 +--- a/tests/test_parser_v1.py ++++ b/tests/test_parser_v1.py +@@ -77,6 +77,7 @@ def bytes_to_service_info( + advertisement=None, + connectable=False, + time=ADVERTISEMENT_TIME, ++ tx_power=None, + ) + + +@@ -96,6 +97,7 @@ def bytes_to_encrypted_service_info( + advertisement=None, + connectable=False, + time=ADVERTISEMENT_TIME, ++ tx_power=None, + ) + + +@@ -1195,6 +1197,7 @@ def test_bthome_multiple_uuids(caplog): + advertisement=None, + connectable=False, + time=ADVERTISEMENT_TIME, ++ tx_power=None, + ) + + device = BTHomeBluetoothDeviceData() +diff --git a/tests/test_parser_v2.py b/tests/test_parser_v2.py +index 8fee31a..3ff8bc3 100644 +--- a/tests/test_parser_v2.py ++++ b/tests/test_parser_v2.py +@@ -97,6 +97,7 @@ def bytes_to_service_info( + advertisement=None, + connectable=False, + time=time, ++ tx_power=None, + ) + + +@@ -3171,6 +3172,7 @@ def test_bthome_multiple_uuids(caplog): + advertisement=None, + connectable=False, + time=ADVERTISEMENT_TIME, ++ tx_power=None, + ) + + device = BTHomeBluetoothDeviceData()