about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2023-12-13 23:30:52 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2023-12-13 23:32:02 +0100
commit7d90dd0a2f06c910a70b917e79e171b932af9d5c (patch)
tree3fd74fd9d99468fa82a18ab0298c2c8aa42ec3bb
parent604365c826de879261fece225683ed7331e218bc (diff)
python311Packages.bleak-esphome: init at 0.2.0
Bleak backend of ESPHome

https://github.com/bluetooth-devices/bleak-esphome
-rw-r--r--pkgs/development/python-modules/bleak-esphome/default.nix60
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/bleak-esphome/default.nix b/pkgs/development/python-modules/bleak-esphome/default.nix
new file mode 100644
index 0000000000000..8a6f46eaca9ee
--- /dev/null
+++ b/pkgs/development/python-modules/bleak-esphome/default.nix
@@ -0,0 +1,60 @@
+{ lib
+, aioesphomeapi
+, bleak
+, bluetooth-data-tools
+, buildPythonPackage
+, fetchFromGitHub
+, habluetooth
+, poetry-core
+, pytest-asyncio
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "bleak-esphome";
+  version = "0.2.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.10";
+
+  src = fetchFromGitHub {
+    owner = "bluetooth-devices";
+    repo = "bleak-esphome";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-QtSkrX7xGaV/13FonQhYR4MpZxVwR8dAFCRvID0zSGo=";
+  };
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace " --cov=bleak_esphome --cov-report=term-missing:skip-covered" ""
+  '';
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    aioesphomeapi
+    bleak
+    bluetooth-data-tools
+    habluetooth
+  ];
+
+  nativeCheckInputs = [
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "bleak_esphome"
+  ];
+
+  meta = with lib; {
+    description = "Bleak backend of ESPHome";
+    homepage = "https://github.com/bluetooth-devices/bleak-esphome";
+    changelog = "https://github.com/bluetooth-devices/bleak-esphome/blob/${version}/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 07f44dcf96fda..6cf94c6a8abbe 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1496,6 +1496,8 @@ self: super: with self; {
 
   bleak = callPackage ../development/python-modules/bleak { };
 
+  bleak-esphome = callPackage ../development/python-modules/bleak-esphome { };
+
   bleak-retry-connector = callPackage ../development/python-modules/bleak-retry-connector { };
 
   blebox-uniapi = callPackage ../development/python-modules/blebox-uniapi { };