From 743a7ab1ca58347373cf93086d0a9867a2368e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 16 Jun 2021 14:57:37 +0200 Subject: [PATCH 1/3] python3Packages.pycontrol4: init at 0.1.0 --- .../python-modules/pycontrol4/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/pycontrol4/default.nix diff --git a/pkgs/development/python-modules/pycontrol4/default.nix b/pkgs/development/python-modules/pycontrol4/default.nix new file mode 100644 index 000000000000..93f7dcdc0a23 --- /dev/null +++ b/pkgs/development/python-modules/pycontrol4/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, aiohttp +, xmltodict +}: + +buildPythonPackage rec { + pname = "pycontrol4"; + version = "0.1.0"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "lawtancool"; + repo = "pyControl4"; + rev = "v${version}"; + sha256 = "0idw9kv6yxrbp0r33vb1jlzgil20m2rjjfrxhcwxmbjjqv93zn6d"; + }; + + propagatedBuildInputs = [ + aiohttp + xmltodict + ]; + + # tests access network + doCheck = false; + + pythonImportsCheck = [ + "pyControl4.account" + "pyControl4.alarm" + "pyControl4.director" + "pyControl4.light" + ]; + + meta = with lib; { + description = "Python 3 asyncio package for interacting with Control4 systems"; + homepage = "https://github.com/lawtancool/pyControl4"; + license = licenses.asl20; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 528d5dffbf76..7e7103781a29 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5222,6 +5222,8 @@ in { pyatag = callPackage ../development/python-modules/pyatag { }; + pycontrol4 = callPackage ../development/python-modules/pycontrol4 { }; + pyfireservicerota = callPackage ../development/python-modules/pyfireservicerota { }; pyflick = callPackage ../development/python-modules/pyflick { }; From 2e2ac868667eda0a1929ce8118723a26412d62cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 16 Jun 2021 14:58:21 +0200 Subject: [PATCH 2/3] home-assistant: update component-packages.nix --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 04abaab961a9..a3b49d14a423 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -138,7 +138,7 @@ "concord232" = ps: with ps; [ ]; # missing inputs: concord232 "config" = ps: with ps; [ aiohttp-cors ]; "configurator" = ps: with ps; [ ]; - "control4" = ps: with ps; [ ]; # missing inputs: pyControl4 + "control4" = ps: with ps; [ pycontrol4 ]; "conversation" = ps: with ps; [ aiohttp-cors ]; "coolmaster" = ps: with ps; [ ]; # missing inputs: pycoolmasternet-async "coronavirus" = ps: with ps; [ coronavirus ]; From 5f3f57281c208ab8db8f048232ac31ae701fe572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 16 Jun 2021 15:00:06 +0200 Subject: [PATCH 3/3] home-assistant: test control4 component --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index ac84462d9f39..6ca15a8a4e59 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -332,6 +332,7 @@ in with py.pkgs; buildPythonApplication rec { "compensation" "config" "configurator" + "control4" "conversation" "coronavirus" "counter"