From 83b83dee939f03e4e9dda7c5d67d8d955b17eed4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 22 Jun 2024 14:45:45 +0200 Subject: [PATCH 1/2] python312Packages.motionblindsble: init at 0.1.0 Module to interface with Motionblinds motors using Bluetooth Low Energy (BLE) https://github.com/LennP/motionblindsble --- .../motionblindsble/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/motionblindsble/default.nix diff --git a/pkgs/development/python-modules/motionblindsble/default.nix b/pkgs/development/python-modules/motionblindsble/default.nix new file mode 100644 index 000000000000..d1708e08bee4 --- /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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 076e5131f1b8..666dc7430b29 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7780,6 +7780,8 @@ self: super: with self; { motionblinds = callPackage ../development/python-modules/motionblinds { }; + motionblindsble = callPackage ../development/python-modules/motionblindsble { }; + motioneye-client = callPackage ../development/python-modules/motioneye-client { }; moto = callPackage ../development/python-modules/moto { }; From 927af5c9aea94a52be46807a77097422413ef6c3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 22 Jun 2024 14:48:47 +0200 Subject: [PATCH 2/2] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 4f5f52c3522e..c56be24eaac5 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2893,6 +2893,7 @@ hassil home-assistant-intents ifaddr + motionblindsble mutagen psutil-home-assistant pyserial @@ -2900,7 +2901,7 @@ sqlalchemy webrtc-noise-gain zeroconf - ]; # missing inputs: motionblindsble + ]; "motioneye" = ps: with ps; [ motioneye-client ]; @@ -5663,6 +5664,7 @@ "moon" "mopeka" "motion_blinds" + "motionblinds_ble" "motioneye" "motionmount" "mqtt"