From a7f0a58c4b775bf0525e1f7032c91ca7be2ca99d Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Sun, 6 Jan 2019 21:28:22 +0800 Subject: [PATCH 1/2] pythonPackages.zm-py: init at 0.3.0 --- .../python-modules/zm-py/default.nix | 29 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/development/python-modules/zm-py/default.nix diff --git a/pkgs/development/python-modules/zm-py/default.nix b/pkgs/development/python-modules/zm-py/default.nix new file mode 100644 index 00000000000..d7f212f2284 --- /dev/null +++ b/pkgs/development/python-modules/zm-py/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchPypi, buildPythonPackage, isPy3k +, pytest, requests }: + +buildPythonPackage rec { + pname = "zm-py"; + version = "0.3.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1hq83svprd21r74palhs3xq15g34135349y4lrgr7c76i3f37j2q"; + }; + + disabled = !isPy3k; + + propagatedBuildInputs = [ requests ]; + + checkInputs = [ pytest ]; + + checkPhase = '' + PYTHONPATH="./zoneminder:$PYTHONPATH" pytest + ''; + + meta = with lib; { + description = "A loose python wrapper around the ZoneMinder REST API"; + homepage = https://github.com/rohankapoorcom/zm-py; + license = licenses.asl20; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 983e5b814fb..50c08d5e087 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5159,6 +5159,8 @@ in { inherit python; })).python; + zm-py = callPackage ../development/python-modules/zm-py { }; + rfc7464 = callPackage ../development/python-modules/rfc7464 { }; foundationdb51 = callPackage ../servers/foundationdb/python.nix { foundationdb = pkgs.foundationdb51; }; From 7aff24f4b0933f7ba61f10d2481fc349617f1870 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Sat, 19 Jan 2019 21:02:31 +0800 Subject: [PATCH 2/2] ha: use zm-py for zoneminder --- pkgs/servers/home-assistant/component-packages.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index c28160b04a4..70f99783583 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -222,7 +222,7 @@ "camera.xeoma" = ps: with ps; [ ]; "camera.xiaomi" = ps: with ps; [ ha-ffmpeg ]; "camera.yi" = ps: with ps; [ ha-ffmpeg ]; - "camera.zoneminder" = ps: with ps; [ ]; + "camera.zoneminder" = ps: with ps; [ zm-py ]; "canary" = ps: with ps; [ ]; "cast" = ps: with ps; [ PyChromecast ]; "climate" = ps: with ps; [ ]; @@ -1226,7 +1226,7 @@ "sensor.zestimate" = ps: with ps; [ xmltodict ]; "sensor.zha" = ps: with ps; [ ]; "sensor.zigbee" = ps: with ps; [ ]; - "sensor.zoneminder" = ps: with ps; [ ]; + "sensor.zoneminder" = ps: with ps; [ zm-py ]; "sensor.zwave" = ps: with ps; [ ]; "shell_command" = ps: with ps; [ ]; "shiftr" = ps: with ps; [ paho-mqtt ]; @@ -1362,7 +1362,7 @@ "switch.xiaomi_miio" = ps: with ps; [ construct ]; "switch.zha" = ps: with ps; [ ]; "switch.zigbee" = ps: with ps; [ ]; - "switch.zoneminder" = ps: with ps; [ ]; + "switch.zoneminder" = ps: with ps; [ zm-py ]; "switch.zwave" = ps: with ps; [ ]; "system_log" = ps: with ps; [ aiohttp-cors ]; "tado" = ps: with ps; [ ]; @@ -1473,7 +1473,7 @@ "zone.config_flow" = ps: with ps; [ ]; "zone.const" = ps: with ps; [ ]; "zone.zone" = ps: with ps; [ ]; - "zoneminder" = ps: with ps; [ ]; + "zoneminder" = ps: with ps; [ zm-py ]; "zwave" = ps: with ps; [ homeassistant-pyozw pydispatcher ]; "zwave.config_flow" = ps: with ps; [ ]; "zwave.const" = ps: with ps; [ ];