summary refs log tree commit diff
path: root/pkgs/development/python-modules/ha-mqtt-discoverable/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/ha-mqtt-discoverable/default.nix')
-rw-r--r--pkgs/development/python-modules/ha-mqtt-discoverable/default.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ha-mqtt-discoverable/default.nix b/pkgs/development/python-modules/ha-mqtt-discoverable/default.nix
new file mode 100644
index 00000000000..5d5eb8ba910
--- /dev/null
+++ b/pkgs/development/python-modules/ha-mqtt-discoverable/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, gitlike-commands
+, paho-mqtt
+, poetry-core
+, pyaml
+, pydantic
+, pythonOlder
+, thelogrus
+}:
+
+buildPythonPackage rec {
+  pname = "ha-mqtt-discoverable";
+  version = "0.10.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.10";
+
+  src = fetchFromGitHub {
+    owner = "unixorn";
+    repo = "ha-mqtt-discoverable";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-0a39KTLZw3Y2D0TXlKCmvVeNoXAN/uLXQGDlA9iM9J0=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    gitlike-commands
+    paho-mqtt
+    pyaml
+    pydantic
+    thelogrus
+  ];
+
+  # Test require a running Mosquitto instance
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "ha_mqtt_discoverable"
+  ];
+
+  meta = with lib; {
+    description = "Python module to create MQTT entities that are automatically discovered by Home Assistant";
+    homepage = "https://github.com/unixorn/ha-mqtt-discoverable";
+    changelog = "https://github.com/unixorn/ha-mqtt-discoverable/releases/tag/v${version}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}