about summary refs log tree commit diff
path: root/pkgs/development/python-modules/motionblindsble/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/motionblindsble/default.nix')
-rw-r--r--pkgs/development/python-modules/motionblindsble/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/motionblindsble/default.nix b/pkgs/development/python-modules/motionblindsble/default.nix
new file mode 100644
index 0000000000000..d1708e08bee43
--- /dev/null
+++ b/pkgs/development/python-modules/motionblindsble/default.nix
@@ -0,0 +1,55 @@
+{
+  lib,
+  bleak-retry-connector,
+  bleak,
+  buildPythonPackage,
+  fetchFromGitHub,
+  pycryptodome,
+  pytest-asyncio,
+  pytestCheckHook,
+  pythonOlder,
+  setuptools,
+}:
+
+buildPythonPackage rec {
+  pname = "motionblindsble";
+  version = "0.1.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "LennP";
+    repo = "motionblindsble";
+    rev = "refs/tags/${version}";
+    hash = "sha256-jWd+7jRuJ8UIIZjx8+7BNCwIo+o4mxAFB2csytmnuso=";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace-fail "{{VERSION_PLACEHOLDER}}" "${version}"
+  '';
+
+  build-system = [ setuptools ];
+
+  dependencies = [
+    bleak
+    bleak-retry-connector
+    pycryptodome
+  ];
+
+  nativeCheckInputs = [
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [ "motionblindsble" ];
+
+  meta = with lib; {
+    description = "Module to interface with Motionblinds motors using Bluetooth Low Energy (BLE)";
+    homepage = "https://github.com/LennP/motionblindsble";
+    changelog = "https://github.com/LennP/motionblindsble/releases/tag/${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}