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 000000000000..8a6f46eaca9e --- /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 e9f44f729a9e..111992153909 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1514,6 +1514,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 { };