about summary refs log tree commit diff
path: root/pkgs/development/python-modules/bthome-ble
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-08-19 10:26:00 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2022-08-19 10:26:00 +0200
commit541d973f263486abef38231e0a54ee753e6f787c (patch)
tree787b4df6d01968c7d71d864066187b5b915eb464 /pkgs/development/python-modules/bthome-ble
parent89d3d54fbed455530f6b9af06ad27481854c3bc1 (diff)
python310Packages.bthome-ble: init at 0.2.2
Diffstat (limited to 'pkgs/development/python-modules/bthome-ble')
-rw-r--r--pkgs/development/python-modules/bthome-ble/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/bthome-ble/default.nix b/pkgs/development/python-modules/bthome-ble/default.nix
new file mode 100644
index 0000000000000..5e4f9c87a43a4
--- /dev/null
+++ b/pkgs/development/python-modules/bthome-ble/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, bluetooth-sensor-state-data
+, buildPythonPackage
+, fetchFromGitHub
+, poetry-core
+, pycryptodomex
+, pytestCheckHook
+, pythonOlder
+, sensor-state-data
+}:
+
+buildPythonPackage rec {
+  pname = "bthome-ble";
+  version = "0.2.2";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "Bluetooth-Devices";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-p1ySTp+/gMUo8XWox2s+M7ees6GlxpGCZxNNEJpQbj8=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    bluetooth-sensor-state-data
+    sensor-state-data
+    pycryptodomex
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace " --cov=bthome_ble --cov-report=term-missing:skip-covered" ""
+  '';
+
+  pythonImportsCheck = [
+    "bthome_ble"
+  ];
+
+  meta = with lib; {
+    description = "Library for BThome BLE devices";
+    homepage = "https://github.com/Bluetooth-Devices/bthome-ble";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}