diff --git a/pkgs/development/python-modules/pyhumps/default.nix b/pkgs/development/python-modules/pyhumps/default.nix index 3b6dd18665b5..51d5b8bce5ec 100644 --- a/pkgs/development/python-modules/pyhumps/default.nix +++ b/pkgs/development/python-modules/pyhumps/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchFromGitHub +, fetchpatch , poetry-core , pytestCheckHook , pythonOlder @@ -28,11 +29,14 @@ buildPythonPackage rec { pytestCheckHook ]; - postPatch = '' - # https://github.com/nficano/humps/pull/240 - substituteInPlace pyproject.toml \ - --replace 'version = "3.0.2"' 'version = "${version}"' - ''; + patches = [ + # Fix naming, https://github.com/nficano/humps/pull/246 + (fetchpatch { + name = "fix-naming.patch"; + url = "https://github.com/nficano/humps/commit/118f6bce785d170b10dd3afee467d26dcc8b425d.patch"; + sha256 = "sha256-oQxkLsihnHZlHiZEupwG9Dr1Ss1w+KjDsBtbEVDced4="; + }) + ]; pythonImportsCheck = [ "humps" diff --git a/pkgs/development/python-modules/pyoverkiz/default.nix b/pkgs/development/python-modules/pyoverkiz/default.nix new file mode 100644 index 000000000000..00380f341fcb --- /dev/null +++ b/pkgs/development/python-modules/pyoverkiz/default.nix @@ -0,0 +1,58 @@ +{ lib +, aiohttp +, attrs +, backoff +, boto3 +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pyhumps +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, warrant-lite +}: + +buildPythonPackage rec { + pname = "pyoverkiz"; + version = "1.3.5"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "iMicknl"; + repo = "python-overkiz-api"; + rev = "v${version}"; + hash = "sha256-KxZYluXa15RojAyNe5hA8Yf/Q9/mVl+b0TrDGRE6iuM="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + attrs + aiohttp + backoff + pyhumps + boto3 + warrant-lite + ]; + + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ + "pyoverkiz" + ]; + + meta = with lib; { + description = "Module to interact with the Somfy TaHoma API or other OverKiz APIs"; + homepage = "https://github.com/iMicknl/python-overkiz-api"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 5d6e0bef77f5..9da182daf3bb 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -636,7 +636,7 @@ "orvibo" = ps: with ps; [ orvibo ]; "osramlightify" = ps: with ps; [ ]; # missing inputs: lightify "otp" = ps: with ps; [ pyotp ]; - "overkiz" = ps: with ps; [ ]; # missing inputs: pyoverkiz + "overkiz" = ps: with ps; [ pyoverkiz ]; "ovo_energy" = ps: with ps; [ ovoenergy ]; "owntracks" = ps: with ps; [ pynacl pyturbojpeg aiohttp-cors hass-nabucasa paho-mqtt ]; "ozw" = ps: with ps; [ aiohttp-cors paho-mqtt python-openzwave-mqtt ]; @@ -1399,6 +1399,7 @@ "openuv" "openweathermap" "opnsense" + "overkiz" "ovo_energy" "owntracks" "ozw" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ee3409bea0b4..f26aa551b3dd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6151,6 +6151,8 @@ in { pynx584 = callPackage ../development/python-modules/pynx584 { }; + pyoverkiz = callPackage ../development/python-modules/pyoverkiz { }; + pyownet = callPackage ../development/python-modules/pyownet { }; pypoint = callPackage ../development/python-modules/pypoint { };