about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/switchbot-api/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/switchbot-api/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/switchbot-api/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/switchbot-api/default.nix b/nixpkgs/pkgs/development/python-modules/switchbot-api/default.nix
new file mode 100644
index 000000000000..32df6d5185ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/switchbot-api/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, aiohttp
+, buildPythonPackage
+, fetchFromGitHub
+, poetry-core
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "switchbot-api";
+  version = "2.0.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.10";
+
+  src = fetchFromGitHub {
+    owner = "SeraphicCorp";
+    repo = "py-switchbot-api";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-QM8oVfd+hdVNdhOgI3ujyY82Im0Yr5Nl+OcqzEtZ7XE=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    aiohttp
+  ];
+
+  # Module has no tests
+  doCheck= false;
+
+  pythonImportsCheck = [
+    "switchbot_api"
+  ];
+
+  meta = with lib; {
+    description = "An asynchronous library to use Switchbot API";
+    homepage = "https://github.com/SeraphicCorp/py-switchbot-api";
+    changelog = "https://github.com/SeraphicCorp/py-switchbot-api/releases/tag/v${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}