1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 gitlike-commands,
6 paho-mqtt,
7 poetry-core,
8 pyaml,
9 pydantic,
10 pythonOlder,
11 pythonRelaxDepsHook,
12 thelogrus,
13}:
14
15buildPythonPackage rec {
16 pname = "ha-mqtt-discoverable";
17 version = "0.14.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.10";
21
22 src = fetchFromGitHub {
23 owner = "unixorn";
24 repo = "ha-mqtt-discoverable";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-vL4EzeU+8nUPyLR22MJtLhknWF4DWMo49EKvkIqIWhA=";
27 };
28
29 pythonRelaxDeps = [ "pyaml" ];
30
31 build-system = [ poetry-core ];
32
33 nativeBuildInputs = [ pythonRelaxDepsHook ];
34
35 dependencies = [
36 gitlike-commands
37 paho-mqtt
38 pyaml
39 pydantic
40 thelogrus
41 ];
42
43 # Test require a running Mosquitto instance
44 doCheck = false;
45
46 pythonImportsCheck = [ "ha_mqtt_discoverable" ];
47
48 meta = with lib; {
49 description = "Python module to create MQTT entities that are automatically discovered by Home Assistant";
50 homepage = "https://github.com/unixorn/ha-mqtt-discoverable";
51 changelog = "https://github.com/unixorn/ha-mqtt-discoverable/releases/tag/v${version}";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ fab ];
54 };
55}