1{
2 lib,
3 bleak-retry-connector,
4 bleak,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pycryptodome,
8 pytest-asyncio,
9 pytestCheckHook,
10 pythonOlder,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "motionblindsble";
16 version = "0.1.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "LennP";
23 repo = "motionblindsble";
24 rev = "refs/tags/${version}";
25 hash = "sha256-jWd+7jRuJ8UIIZjx8+7BNCwIo+o4mxAFB2csytmnuso=";
26 };
27
28 postPatch = ''
29 substituteInPlace setup.py \
30 --replace-fail "{{VERSION_PLACEHOLDER}}" "${version}"
31 '';
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 bleak
37 bleak-retry-connector
38 pycryptodome
39 ];
40
41 nativeCheckInputs = [
42 pytest-asyncio
43 pytestCheckHook
44 ];
45
46 pythonImportsCheck = [ "motionblindsble" ];
47
48 meta = with lib; {
49 description = "Module to interface with Motionblinds motors using Bluetooth Low Energy (BLE)";
50 homepage = "https://github.com/LennP/motionblindsble";
51 changelog = "https://github.com/LennP/motionblindsble/releases/tag/${version}";
52 license = licenses.mit;
53 maintainers = with maintainers; [ fab ];
54 };
55}