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 000000000000..d7f212f22844 --- /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/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 36f5bfe53078..66dfc4069ed6 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -221,7 +221,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; [ ]; @@ -1222,7 +1222,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 ]; @@ -1358,7 +1358,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; [ ]; @@ -1468,7 +1468,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; [ ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 279b22788a38..7be2928d7501 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5177,6 +5177,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; };