about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2024-03-11 12:03:07 +0100
committerGitHub <noreply@github.com>2024-03-11 12:03:07 +0100
commit66f47bc6741a0e1a49fd00af97146300516deba7 (patch)
tree75d4719bef3c10369bd07241d0d2948f60d21e79
parentaab8954764c17cb65e066eb109db4ea07aeb4f50 (diff)
parent3ffe0ebddd402ab6ad20b982cdb603a447cba124 (diff)
Merge pull request #294706 from aciceri/tuya
tuya-device-sharing-sdk: init at 0.2.0, home-assistant: update component-packages
-rw-r--r--pkgs/development/python-modules/tuya-device-sharing-sdk/default.nix44
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix4
-rwxr-xr-xpkgs/servers/home-assistant/parse-requirements.py2
-rw-r--r--pkgs/top-level/python-packages.nix2
4 files changed, 50 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/tuya-device-sharing-sdk/default.nix b/pkgs/development/python-modules/tuya-device-sharing-sdk/default.nix
new file mode 100644
index 0000000000000..dd95baba855d4
--- /dev/null
+++ b/pkgs/development/python-modules/tuya-device-sharing-sdk/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, setuptools
+, requests
+, paho-mqtt
+, cryptography
+}:
+let
+  pname = "tuya-device-sharing-sdk";
+  version = "0.2.0";
+in
+buildPythonPackage {
+  inherit pname version;
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-fu8zh59wlnxtstNbNL8mIm10tiXy22oPbi6oUy5x8c8=";
+  };
+
+  # workaround needed, upstream issue: https://github.com/tuya/tuya-device-sharing-sdk/issues/10
+  postPatch = ''
+    touch requirements.txt
+  '';
+
+  build-system = [
+    setuptools
+  ];
+
+  dependencies = [
+    requests
+    paho-mqtt
+    cryptography
+  ];
+
+  doCheck = false; # no tests
+
+  meta = with lib; {
+    description = "Tuya Device Sharing SDK";
+    homepage = "https://github.com/tuya/tuya-device-sharing-sdk";
+    license = licenses.mit;
+    maintainers = with maintainers; [ aciceri ];
+  };
+}
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index b9fc857f211cc..78fbdbadeae22 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -5265,7 +5265,8 @@
     ];
     "tuya" = ps: with ps; [
       ha-ffmpeg
-    ]; # missing inputs: tuya-device-sharing-sdk
+      tuya-device-sharing-sdk
+    ];
     "twentemilieu" = ps: with ps; [
       twentemilieu
     ];
@@ -6574,6 +6575,7 @@
     "transport_nsw"
     "trend"
     "tts"
+    "tuya"
     "twentemilieu"
     "twilio"
     "twinkly"
diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py
index 5ff1510f23517..4a54f351ac490 100755
--- a/pkgs/servers/home-assistant/parse-requirements.py
+++ b/pkgs/servers/home-assistant/parse-requirements.py
@@ -1,5 +1,5 @@
 #! /usr/bin/env nix-shell
-#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ packaging rich ])" -p nodePackages.pyright ruff isort"
+#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ packaging rich ])" -p nodePackages.pyright ruff isort
 #
 # This script downloads Home Assistant's source tarball.
 # Inside the homeassistant/components directory, each integration has an associated manifest.json,
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 35757d65166e0..097a37dbd234e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -15034,6 +15034,8 @@ self: super: with self; {
 
   turnt = callPackage ../development/python-modules/turnt { };
 
+  tuya-device-sharing-sdk = callPackage ../development/python-modules/tuya-device-sharing-sdk { };
+
   tuya-iot-py-sdk = callPackage ../development/python-modules/tuya-iot-py-sdk { };
 
   tuyaha = callPackage ../development/python-modules/tuyaha { };