From fa7c441c3337cd30f0bf22208a1d692a5902ca5c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 21:09:06 +0200 Subject: [PATCH 1/6] python3Packages.garminconnect-ha: init at 0.1.6 --- .../garminconnect-ha/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/garminconnect-ha/default.nix diff --git a/pkgs/development/python-modules/garminconnect-ha/default.nix b/pkgs/development/python-modules/garminconnect-ha/default.nix new file mode 100644 index 000000000000..e3d4cd5b48e9 --- /dev/null +++ b/pkgs/development/python-modules/garminconnect-ha/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, requests +}: + +buildPythonPackage rec { + pname = "garminconnect-ha"; + version = "0.1.6"; + + src = fetchFromGitHub { + owner = "cyberjunky"; + repo = "python-garminconnect-ha"; + rev = version; + sha256 = "0ngas6zikhpja1cdkq64m9pjm4b0z3qaj9g3x88mggy60jsxm1d7"; + }; + + propagatedBuildInputs = [ + requests + ]; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ "garminconnect_ha" ]; + + meta = with lib; { + description = "Minimal Garmin Connect Python 3 API wrapper for Home Assistant"; + homepage = "https://github.com/cyberjunky/python-garminconnect-ha"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2c51f9ccbab9..13fd1d2b2415 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2706,6 +2706,8 @@ in { garminconnect-aio = callPackage ../development/python-modules/garminconnect-aio { }; + garminconnect-ha = callPackage ../development/python-modules/garminconnect-ha { }; + gast = callPackage ../development/python-modules/gast { }; garages-amsterdam = callPackage ../development/python-modules/garages-amsterdam { }; From 8f2432d85545034d3f65d116cc239122382350d8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 21:11:09 +0200 Subject: [PATCH 2/6] home-assistant: pin iaqualink at 0.3.90 --- pkgs/servers/home-assistant/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index bf1798a905f5..e813a0ffb84c 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -52,12 +52,12 @@ let # https://github.com/home-assistant/core/pull/48137 was merged (self: super: { iaqualink = super.iaqualink.overridePythonAttrs (oldAttrs: rec { - version = "0.3.4"; + version = "0.3.90"; src = fetchFromGitHub { owner = "flz"; repo = "iaqualink-py"; rev = "v${version}"; - sha256 = "16mn6nd9x3hm6j6da99qhwbqs95hh8wx21r1h1m9csl76z77n9lh"; + sha256 = "0c8ckbbr1n8gx5k63ymgyfkbz3d0rbdvghg8fqdvbg4nrigrs5v0"; }; checkInputs = oldAttrs.checkInputs ++ [ python3.pkgs.asynctest ]; }); From 0e13e113989df31d6e290d99764584b581420a03 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 21:16:08 +0200 Subject: [PATCH 3/6] home-assistant: fix home-assistant-frontend update An incomplete rename of attributes caused a mismatch in expectations between the update script and what the home-assistant package exposed. --- pkgs/servers/home-assistant/default.nix | 5 ++--- pkgs/servers/home-assistant/update.sh | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index e813a0ffb84c..6bc7248f00ed 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -219,7 +219,7 @@ in with py.pkgs; buildPythonApplication rec { ''; propagatedBuildInputs = [ - # Only packages required in setup.py + hass-frontend + # Only packages required in setup.py aiohttp astral async-timeout @@ -798,11 +798,10 @@ in with py.pkgs; buildPythonApplication rec { ''; passthru = { - inherit (py.pkgs) hass-frontend; + python = py; tests = { inherit (nixosTests) home-assistant; }; - python = py; }; meta = with lib; { diff --git a/pkgs/servers/home-assistant/update.sh b/pkgs/servers/home-assistant/update.sh index e80b7acbed0f..5ed865f411e2 100755 --- a/pkgs/servers/home-assistant/update.sh +++ b/pkgs/servers/home-assistant/update.sh @@ -26,7 +26,7 @@ sed -i -e "s/hassVersion =.*/hassVersion = \"${TARGET_VERSION}\";/" \ ./parse-requirements.py ( cd ../../.. - nix-update --version "$FRONTEND_VERSION" home-assistant.hass-frontend + nix-update --version "$FRONTEND_VERSION" home-assistant.python.pkgs.home-assistant-frontend nix-update --version "$TARGET_VERSION" --build home-assistant ) From 4e1932f574ed140772bd75432570790d36fc6fd2 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 21:17:24 +0200 Subject: [PATCH 4/6] home-assistant: 2021.6.4 -> 2021.6.5 --- pkgs/servers/home-assistant/component-packages.nix | 4 ++-- pkgs/servers/home-assistant/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 37e6f472fd61..f1b0d42aa4a2 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2,7 +2,7 @@ # Do not edit! { - version = "2021.6.4"; + version = "2021.6.5"; components = { "abode" = ps: with ps; [ abodepy ]; "accuweather" = ps: with ps; [ accuweather ]; @@ -293,7 +293,7 @@ "futurenow" = ps: with ps; [ pyfnip ]; "garadget" = ps: with ps; [ ]; "garages_amsterdam" = ps: with ps; [ garages-amsterdam ]; - "garmin_connect" = ps: with ps; [ garminconnect-aio ]; + "garmin_connect" = ps: with ps; [ garminconnect-ha ]; "gc100" = ps: with ps; [ ]; # missing inputs: python-gc100 "gdacs" = ps: with ps; [ aio-georss-gdacs ]; "generic" = ps: with ps; [ ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 6bc7248f00ed..9c03f34c924a 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -181,7 +181,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "2021.6.4"; + hassVersion = "2021.6.5"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -200,7 +200,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "058dx5hg0a3zvd85sxglbadigfzajmzx8i5jxvw0ww9yp8002qj1"; + sha256 = "1cp294hy35k9hjbp8iqmaf1m5qbbkh3jwf92ym49waw8di5a5wvh"; }; # leave this in, so users don't have to constantly update their downstream patch handling From 4eddeb7a0fad36cf6a0a3b9bbbfd2ae5dee92893 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 21:26:54 +0200 Subject: [PATCH 5/6] python3Packages.pydaikin: 2.4.1 -> 2.4.2 --- pkgs/development/python-modules/pydaikin/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pydaikin/default.nix b/pkgs/development/python-modules/pydaikin/default.nix index 209ef3dbc235..fbb205bb9f78 100644 --- a/pkgs/development/python-modules/pydaikin/default.nix +++ b/pkgs/development/python-modules/pydaikin/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "pydaikin"; - version = "2.4.1"; + version = "2.4.2"; disabled = pythonOlder "3.6"; src = fetchFromBitbucket { owner = "mustang51"; repo = pname; rev = "v${version}"; - sha256 = "1624adp4lqd1n9flnf0wqrcibml2nd19ga3fmxzjg4x5z6767bs3"; + sha256 = "13cslszjhd1x7j0ja0n0wpy62hb2sdmkrmjl3qhwqfggps2w2wy1"; }; propagatedBuildInputs = [ @@ -28,6 +28,10 @@ buildPythonPackage rec { urllib3 ]; + # while they have tests, they do not run them in their CI and they fail as of 2.4.2 + # AttributeError: 'DaikinBRP069' object has no attribute 'last_hour_cool_energy_consumption' + doCheck = false; + checkInputs = [ freezegun pytest-aiohttp From 3b1494252c4517aa8934c761e88b8543c471f964 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 16 Jun 2021 00:24:11 +0200 Subject: [PATCH 6/6] home-assistant: drop tzdata workaround The backports-zoneinfo package was fixed by patching in the reference to the tzdata files, this means we don't have to export PYTHONTZPATH anymore. --- pkgs/servers/home-assistant/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 9c03f34c924a..4737b9597976 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -3,7 +3,6 @@ , fetchFromGitHub , python3 , inetutils -, tzdata , nixosTests # Look up dependencies of specified components in component-packages.nix @@ -785,9 +784,6 @@ in with py.pkgs; buildPythonApplication rec { # put ping binary into PATH, e.g. for wake_on_lan tests export PATH=${inetutils}/bin:$PATH - # set up zoneinfo data for backports-zoneinfo in pvpc_hourly_pricing tests - export PYTHONTZPATH="${tzdata}/share/zoneinfo" - # error out when component test directory is missing, otherwise hidden by xdist execution :( for component in ${lib.concatStringsSep " " (map lib.escapeShellArg componentTests)}; do test -d "tests/components/$component" || {