From f30a2b7de92ea26930a9037f295f5b875dde4e68 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 29 Oct 2022 11:45:01 +0200 Subject: [PATCH 1/2] python310Packages.pyswitchbee: init at 1.6.0 --- .../python-modules/pyswitchbee/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/pyswitchbee/default.nix diff --git a/pkgs/development/python-modules/pyswitchbee/default.nix b/pkgs/development/python-modules/pyswitchbee/default.nix new file mode 100644 index 000000000000..68788b5796a7 --- /dev/null +++ b/pkgs/development/python-modules/pyswitchbee/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, aiohttp +, fetchFromGitHub +, setuptools +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pyswitchbee"; + version = "1.6.0"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "jafar-atili"; + repo = "pySwitchbee"; + rev = "refs/tags/${version}"; + hash = "sha256-ZAe47Oxw5n6OM/PRKz7OR8yzi/c9jnXeOYNjCbs0j1E="; + }; + + postPatch = '' + # https://github.com/jafar-atili/pySwitchbee/pull/2 + substituteInPlace pyproject.toml \ + --replace '"asyncio",' "" + ''; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + aiohttp + ]; + + # Module doesn't have tests + doCheck = false; + + pythonImportsCheck = [ + "switchbee" + ]; + + meta = with lib; { + description = "Library to control SwitchBee smart home device"; + homepage = "https://github.com/jafar-atili/pySwitchbee/"; + # https://github.com/jafar-atili/pySwitchbee/issues/1 + license = with licenses; [ unfree ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c4714ffe9a52..33a063360b9f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8618,6 +8618,8 @@ self: super: with self; { inherit (pkgs) bash subversion apr aprutil expat neon openssl; }; + pyswitchbee = callPackage ../development/python-modules/pyswitchbee { }; + pyswitchbot = callPackage ../development/python-modules/pyswitchbot { }; pysychonaut = callPackage ../development/python-modules/pysychonaut { }; From 0311fe1f62b4d2e0b37869349b084fe485b95379 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 29 Oct 2022 11:46:18 +0200 Subject: [PATCH 2/2] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 6fe00648b6d9..19d9c09d7936 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2944,7 +2944,8 @@ "switch_as_x" = ps: with ps; [ ]; "switchbee" = ps: with ps; [ - ]; # missing inputs: pyswitchbee + pyswitchbee + ]; "switchbot" = ps: with ps; [ pyswitchbot aiohttp-cors @@ -4174,6 +4175,7 @@ "surepetcare" "switch" "switch_as_x" + "switchbee" "switchbot" "switcher_kis" "syncthing"