From 7d90dd0a2f06c910a70b917e79e171b932af9d5c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 13 Dec 2023 23:30:52 +0100 Subject: python311Packages.bleak-esphome: init at 0.2.0 Bleak backend of ESPHome https://github.com/bluetooth-devices/bleak-esphome --- .../python-modules/bleak-esphome/default.nix | 60 ++++++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/python-modules/bleak-esphome/default.nix 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 { }; -- cgit 1.4.1