diff --git a/pkgs/development/python-modules/graphql-subscription-manager/default.nix b/pkgs/development/python-modules/graphql-subscription-manager/default.nix new file mode 100644 index 000000000000..1a3c32e04d44 --- /dev/null +++ b/pkgs/development/python-modules/graphql-subscription-manager/default.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, setuptools +, websockets +}: + +buildPythonPackage rec { + pname = "graphql-subscription-manager"; + version = "0.4.0"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "Danielhiversen"; + repo = "PyGraphqlWebsocketManager"; + rev = version; + sha256 = "1176xzr9fa7gl5cm0pcv5lb45d2ms5awi601rjcr3a0a14a1i8fz"; + }; + + propagatedBuildInputs = [ + setuptools + websockets + ]; + + # no tests implemented + doCheck = false; + + pythonImportsCheck = [ "graphql_subscription_manager" ]; + + meta = with lib; { + description = "Python3 library for graphql subscription manager"; + homepage = "https://github.com/Danielhiversen/PyGraphqlWebsocketManager"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/pytibber/default.nix b/pkgs/development/python-modules/pytibber/default.nix new file mode 100644 index 000000000000..a8814b1e783e --- /dev/null +++ b/pkgs/development/python-modules/pytibber/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, aiohttp +, async-timeout +, graphql-subscription-manager +, python-dateutil +, pytz +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pytibber"; + version = "0.17.1"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "Danielhiversen"; + repo = "pyTibber"; + rev = version; + sha256 = "1zda9cvg6hy0n7sr2z71lkyl93n1gnzxrvf56lhz13pcsffshhdk"; + }; + + propagatedBuildInputs = [ + aiohttp + async-timeout + graphql-subscription-manager + python-dateutil + pytz + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test/test.py" ]; + + # tests access network + doCheck = false; + + pythonImportsCheck = [ "tibber" ]; + + meta = with lib; { + description = "A python3 library to communicate with Tibber"; + homepage = "https://github.com/Danielhiversen/pyTibber"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 5e70d9100410..b76dc270d32d 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -861,7 +861,7 @@ "thinkingcleaner" = ps: with ps; [ ]; # missing inputs: pythinkingcleaner "thomson" = ps: with ps; [ ]; "threshold" = ps: with ps; [ ]; - "tibber" = ps: with ps; [ ]; # missing inputs: pyTibber + "tibber" = ps: with ps; [ pytibber ]; "tikteck" = ps: with ps; [ ]; # missing inputs: tikteck "tile" = ps: with ps; [ pytile ]; "time_date" = ps: with ps; [ ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 0892859dd5fd..a2e983a73859 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -634,6 +634,7 @@ in with py.pkgs; buildPythonApplication rec { "template" "tesla" "threshold" + "tibber" "tile" "time_date" "timer" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 08586736d4f3..2c51f9ccbab9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3017,6 +3017,8 @@ in { graphql-server-core = callPackage ../development/python-modules/graphql-server-core { }; + graphql-subscription-manager = callPackage ../development/python-modules/graphql-subscription-manager { }; + graph-tool = callPackage ../development/python-modules/graph-tool/2.x.x.nix { }; graphtage = callPackage ../development/python-modules/graphtage { }; @@ -6977,6 +6979,8 @@ in { pyeverlights = callPackage ../development/python-modules/pyeverlights { }; + pytibber = callPackage ../development/python-modules/pytibber { }; + pytile = callPackage ../development/python-modules/pytile { }; pytimeparse = callPackage ../development/python-modules/pytimeparse { };