about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-02-08 20:24:58 +0100
committerGitHub <noreply@github.com>2021-02-08 20:24:58 +0100
commit872b4b9df158c065915cad69e924dfc98c6ec956 (patch)
tree7af7b94c933605c99f94b9a1c5261a451ef5ad1a /pkgs
parent2630a2df91f23d1ac6ed4c257f86c28a422dda44 (diff)
parenta336467d7ce4d8bd1a01624292ed94705cc2b435 (diff)
Merge pull request #112403 from fabaff/libpurecool
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/libpurecool/default.nix47
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix2
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 50 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/libpurecool/default.nix b/pkgs/development/python-modules/libpurecool/default.nix
new file mode 100644
index 0000000000000..aa523d9a98bf3
--- /dev/null
+++ b/pkgs/development/python-modules/libpurecool/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, netifaces
+, paho-mqtt
+, pycryptodome
+, requests
+, six
+, zeroconf
+}:
+
+buildPythonPackage rec {
+  pname = "libpurecool";
+  version = "0.6.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1kwbinbg0i4fca1bpx6jwa1fiw71vg0xa89jhq4pmnl5cn9c8kqx";
+  };
+
+  # Remove vendorized zeroconf, https://github.com/etheralm/libpurecool/issues/33
+  postPatch = ''
+    rm libpurecool/zeroconf.py
+    substituteInPlace libpurecool/dyson_pure_cool_link.py \
+      --replace "from .zeroconf import ServiceBrowser, Zeroconf" "from zeroconf import ServiceBrowser, Zeroconf"
+  '';
+
+  propagatedBuildInputs = [
+    netifaces
+    paho-mqtt
+    pycryptodome
+    requests
+    six
+    zeroconf
+  ];
+
+  # Tests are only present in repo, https://github.com/etheralm/libpurecool/issues/36
+  doCheck = false;
+  pythonImportsCheck = [ "libpurecool" ];
+
+  meta = with lib; {
+    description = "Python library for Dyson devices";
+    homepage = "http://libpurecool.readthedocs.io";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index 7bf7be63d668b..95506e378f282 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -195,7 +195,7 @@
     "dwd_weather_warnings" = ps: with ps; [ ]; # missing inputs: dwdwfsapi
     "dweet" = ps: with ps; [ ]; # missing inputs: dweepy
     "dynalite" = ps: with ps; [ ]; # missing inputs: dynalite_devices
-    "dyson" = ps: with ps; [ aiohttp-cors zeroconf ]; # missing inputs: libpurecool
+    "dyson" = ps: with ps; [ aiohttp-cors libpurecool zeroconf ];
     "eafm" = ps: with ps; [ aioeafm ];
     "ebox" = ps: with ps; [ ]; # missing inputs: pyebox
     "ebusd" = ps: with ps; [ ]; # missing inputs: ebusdpy
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 2483bf9ec7566..eafc426858f5e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -3660,6 +3660,8 @@ in {
     inherit python;
   })).py;
 
+  libpurecool = callPackage ../development/python-modules/libpurecool { };
+
   libredwg = toPythonModule (pkgs.libredwg.override {
     enablePython = true;
     inherit (self) python libxml2;