From 724b8ca51ee57b5d89de063b48ed11d21bb2e1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 6 Feb 2024 15:26:21 -0800 Subject: [PATCH 1/2] python311Packages.bluecurrent-api: init at 1.0.6 --- .../bluecurrent-api/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/bluecurrent-api/default.nix diff --git a/pkgs/development/python-modules/bluecurrent-api/default.nix b/pkgs/development/python-modules/bluecurrent-api/default.nix new file mode 100644 index 000000000000..d8b56e88a286 --- /dev/null +++ b/pkgs/development/python-modules/bluecurrent-api/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, pythonRelaxDepsHook +, setuptools +, pytz +, websockets +, pytest-mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "bluecurrent-api"; + version = "1.0.6"; + pyproject = true; + + disabled = pythonOlder "3.9"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-XHVdtkiG0ff/OY8g+W5iur7OAyhhk1UGA+XUfB2L8/o="; + }; + + nativeBuildInputs = [ + pythonRelaxDepsHook + setuptools + ]; + + pythonRemoveDeps = [ + "asyncio" + ]; + + propagatedBuildInputs = [ + pytz + websockets + ]; + + pythonImportsCheck = [ "bluecurrent_api" ]; + + nativeCheckInputs = [ + pytest-mock + pytestCheckHook + ]; + + meta = { + description = "Wrapper for the Blue Current websocket api"; + homepage = "https://github.com/bluecurrent/HomeAssistantAPI"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 70f3665d5e42..b268f468634d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1575,6 +1575,8 @@ self: super: with self; { blosc2 = callPackage ../development/python-modules/blosc2 { }; + bluecurrent-api = callPackage ../development/python-modules/bluecurrent-api { }; + bluemaestro-ble = callPackage ../development/python-modules/bluemaestro-ble { }; bluepy = callPackage ../development/python-modules/bluepy { }; From b39d11c4a438138893fe1999e74754dc2c734eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 6 Feb 2024 15:27:46 -0800 Subject: [PATCH 2/2] home-assistant: support blue_current component --- pkgs/development/python-modules/bluecurrent-api/default.nix | 2 ++ pkgs/servers/home-assistant/component-packages.nix | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/bluecurrent-api/default.nix b/pkgs/development/python-modules/bluecurrent-api/default.nix index d8b56e88a286..ca19887a0fb0 100644 --- a/pkgs/development/python-modules/bluecurrent-api/default.nix +++ b/pkgs/development/python-modules/bluecurrent-api/default.nix @@ -6,6 +6,7 @@ , setuptools , pytz , websockets +, pytest-asyncio , pytest-mock , pytestCheckHook }: @@ -39,6 +40,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "bluecurrent_api" ]; nativeCheckInputs = [ + pytest-asyncio pytest-mock pytestCheckHook ]; diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 3375151ae042..8b8b626d5a01 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -419,7 +419,8 @@ "bloomsky" = ps: with ps; [ ]; "blue_current" = ps: with ps; [ - ]; # missing inputs: bluecurrent-api + bluecurrent-api + ]; "bluemaestro" = ps: with ps; [ aioesphomeapi aiohttp-cors @@ -5784,6 +5785,7 @@ "blackbird" "blebox" "blink" + "blue_current" "bluemaestro" "blueprint" "bluetooth"