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,
13 pytest-mock,
14 pytestCheckHook,
15 pythonOlder,
16 transitions,
17}:
18
19buildPythonPackage rec {
20 pname = "pysnooz";
21 version = "0.10.0";
22 format = "pyproject";
23
24 disabled = pythonOlder "3.9";
25
26 src = fetchFromGitHub {
27 owner = "AustinBrunkhorst";
28 repo = pname;
29 tag = "v${version}";
30 hash = "sha256-jOXmaJprU35sdNRrBBx/YUyiDyyaE1qodWksXkTSEe0=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace 'transitions = "^0.8.11"' 'transitions = ">=0.8.11"' \
36 --replace 'Events = "^0.4"' 'Events = ">=0.4"' \
37 --replace " --cov=pysnooz --cov-report=term-missing:skip-covered" ""
38 '';
39
40 nativeBuildInputs = [ poetry-core ];
41
42 propagatedBuildInputs = [
43 bleak
44 bleak-retry-connector
45 bluetooth-sensor-state-data
46 events
47 home-assistant-bluetooth
48 transitions
49 ];
50
51 nativeCheckInputs = [
52 freezegun
53 pytest-asyncio
54 pytest-mock
55 pytestCheckHook
56 ];
57
58 pythonImportsCheck = [ "pysnooz" ];
59
60 meta = with lib; {
61 description = "Library to control SNOOZ white noise machines";
62 homepage = "https://github.com/AustinBrunkhorst/pysnooz";
63 changelog = "https://github.com/AustinBrunkhorst/pysnooz/blob/v${version}/CHANGELOG.md";
64 license = with licenses; [ mit ];
65 maintainers = with maintainers; [ fab ];
66 };
67}