summary refs log tree commit diff
path: root/pkgs/development/python-modules/oemthermostat/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/oemthermostat/default.nix')
-rw-r--r--pkgs/development/python-modules/oemthermostat/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/oemthermostat/default.nix b/pkgs/development/python-modules/oemthermostat/default.nix
new file mode 100644
index 00000000000..7a2ecfc26c0
--- /dev/null
+++ b/pkgs/development/python-modules/oemthermostat/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+, pythonOlder
+, requests
+, setuptools-scm
+}:
+
+buildPythonPackage rec {
+  pname = "oemthermostat";
+  version = "1.1.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "Cadair";
+    repo = "openenergymonitor_thermostat";
+    rev = "v${version}";
+    sha256 = "vrMw3/X8MtejO1WyUA1DOlfVCPTCPgcK5p3+OlTWcM4=";
+  };
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+
+  propagatedBuildInputs = [
+    requests
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "oemthermostat"
+  ];
+
+  meta = with lib; {
+    description = "Python module to interact with OpenEnergyMonitor thermostats";
+    homepage = "https://github.com/Cadair/openenergymonitor_thermostat";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fab ];
+  };
+}