1{
2 lib,
3 bleak,
4 bleak-retry-connector,
5 bluetooth-sensor-state-data,
6 buildPythonPackage,
7 events,
8 fetchFromGitHub,
9 freezegun,
10 home-assistant-bluetooth,
11 poetry-core,
12 pytest-asyncio_0,
13 pytest-cov-stub,
14 pytest-mock,
15 pytestCheckHook,
16 pythonOlder,
17 transitions,
18}:
19
20buildPythonPackage rec {
21 pname = "pysnooz";
22 version = "0.10.0";
23 pyproject = true;
24
25 disabled = pythonOlder "3.9";
26
27 src = fetchFromGitHub {
28 owner = "AustinBrunkhorst";
29 repo = "pysnooz";
30 tag = "v${version}";
31 hash = "sha256-jOXmaJprU35sdNRrBBx/YUyiDyyaE1qodWksXkTSEe0=";
32 };
33
34 patches = [
35 # https://github.com/AustinBrunkhorst/pysnooz/pull/20
36 ./bleak-compat.patch
37 ];
38
39 postPatch = ''
40 substituteInPlace pyproject.toml \
41 --replace-fail 'transitions = "^0.8.11"' 'transitions = ">=0.8.11"' \
42 --replace-fail 'Events = "^0.4"' 'Events = ">=0.4"'
43 '';
44
45 build-system = [ poetry-core ];
46
47 dependencies = [
48 bleak
49 bleak-retry-connector
50 bluetooth-sensor-state-data
51 events
52 home-assistant-bluetooth
53 transitions
54 ];
55
56 nativeCheckInputs = [
57 freezegun
58 pytest-asyncio_0
59 pytest-cov-stub
60 pytest-mock
61 pytestCheckHook
62 ];
63
64 pythonImportsCheck = [ "pysnooz" ];
65
66 meta = with lib; {
67 description = "Library to control SNOOZ white noise machines";
68 homepage = "https://github.com/AustinBrunkhorst/pysnooz";
69 changelog = "https://github.com/AustinBrunkhorst/pysnooz/blob/v${version}/CHANGELOG.md";
70 license = with licenses; [ mit ];
71 maintainers = with maintainers; [ fab ];
72 };
73}