1{ lib
2, amqtt
3, buildPythonPackage
4, fetchFromGitHub
5, paho-mqtt
6, poetry-core
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "roombapy";
14 version = "1.6.5";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "pschmitt";
21 repo = "roombapy";
22 rev = version;
23 sha256 = "sha256-Xjeh29U+FCzI5n/i5s6wC0B88Ktmb8pnNDdOzCiKWi4=";
24 };
25
26 nativeBuildInputs = [
27 poetry-core
28 ];
29
30 propagatedBuildInputs = [
31 paho-mqtt
32 ];
33
34 checkInputs = [
35 amqtt
36 pytest-asyncio
37 pytestCheckHook
38 ];
39
40 postPatch = ''
41 # hbmqtt was replaced by amqtt
42 substituteInPlace tests/test_roomba_integration.py \
43 --replace "from hbmqtt.broker import Broker" "from amqtt.broker import Broker"
44 '';
45
46 disabledTestPaths = [
47 # Requires network access
48 "tests/test_discovery.py"
49 ];
50
51 disabledTests = [
52 # Test want to connect to a local MQTT broker
53 "test_roomba_connect"
54 ];
55
56 pythonImportsCheck = [
57 "roombapy"
58 ];
59
60 meta = with lib; {
61 description = "Python program and library to control Wi-Fi enabled iRobot Roombas";
62 homepage = "https://github.com/pschmitt/roombapy";
63 license = licenses.mit;
64 maintainers = [ ];
65 };
66}