git.iko.soy/typeable/nixpkgs
on master help sign in
esphome: 2022.1.4 -> 2022.2.3

https://github.com/esphome/esphome/releases/tag/2022.2.0 https://github.com/esphome/esphome/releases/tag/2022.2.1 https://github.com/esphome/esphome/releases/tag/2022.2.2 https://github.com/esphome/esphome/releases/tag/2022.2.3

commit8cf0d966dbdbddbb6c4c4bf5ff684412ef69f21e authorMartin Weinelt <hexa@darmstadt.ccc.de> dateWed 16 Feb 2022, 20:41 (5 years ago) parent5aa133e
3 files changed+4−55
pkgs/tools/misc/esphome/dashboard.nix+2−2 pkgs/tools/misc/esphome/default.nix+2−7 pkgs/tools/misc/esphome/fix-src-permissions.patch−46
pkgs/tools/misc/esphome/dashboard.nix+2−2
@@ -5,11 +5,11 @@
55
66buildPythonPackage rec {
77 pname = "esphome-dashboard";
8− version = "20220116.0";
8+ version = "20220209.0";
99
1010 src = fetchPypi {
1111 inherit pname version;
12− sha256 = "sha256-eItt7AP96juIaP57yGzW/Fb8NAGsns/4nGWQIMv7Xn8=";
12+ sha256 = "sha256-FkFu3SvsowcsOFXvqWmpY3KEypXSb6KcpC/nJbQpDBA=";
1313 };
1414
1515 # no tests
pkgs/tools/misc/esphome/default.nix+2−7
@@ -16,21 +16,16 @@ let
1616in
1717with python.pkgs; buildPythonApplication rec {
1818 pname = "esphome";
19− version = "2022.1.4";
19+ version = "2022.2.3";
2020 format = "setuptools";
2121
2222 src = fetchFromGitHub {
2323 owner = pname;
2424 repo = pname;
2525 rev = version;
26− sha256 = "sha256-Pv4Rh92d+Jb3ZKPgKVyrgVHr6PGTcIYybdFavbnjuPA=";
26+ sha256 = "sha256-Pt57wI1cYTqT65zGOk1/GyvK0BqITxCzWIyXSNZ9D/0=";
2727 };
2828
29− patches = [
30− # fix missing write permissions on src files before modifing them
31− ./fix-src-permissions.patch
32− ];
33−
3429 postPatch = ''
3530 # remove all version pinning (E.g tornado==5.1.1 -> tornado)
3631 sed -i -e "s/==[0-9.]*//" requirements.txt
pkgs/tools/misc/esphome/fix-src-permissions.patchdeleted−46
@@ -1,46 +0,0 @@
1−From f72c5035944065941daaa236b60664657c777726 Mon Sep 17 00:00:00 2001
2−From: Martin Weinelt <hexa@darmstadt.ccc.de>
3−Date: Wed, 23 Jun 2021 04:50:35 +0200
4−Subject: [PATCH] Set u+w for copied src files before trying to overwrite them
5−MIME-Version: 1.0
6−Content-Type: text/plain; charset=UTF-8
7−Content-Transfer-Encoding: 8bit
8−
9−We store esphome in the nix store, which results in its file permissions
10−being 0444. Esphome, when compiling a firmware image, will copy these
11−files from the nix store to a working directory. When updating between
12−versions it will notice these files changed and try to copy the new
13−version over, which would break, because the user had no write
14−permissions on the files.
15−
16−❯ esphome compile 01e4ac.yml
17−INFO Reading configuration 01e4ac.yml...
18−INFO Detected timezone 'CET' with UTC offset 1 and daylight saving time from 27 March 02:00:00 to 30 October 03:00:00
19−INFO Generating C++ source...
20−ERROR Error copying file /nix/store/lmzrgl1arqfd98jcss4rsmmy6dbffddn-esphome-1.19.2/lib/python3.8/site-packages/esphome/components/api/api_connection.cpp to 01e4ac/src/esphome/components/api/api_connection.cpp: [Errno 13] Permission denied: '01e4ac/src/esphome/components/api/api_connection.cpp'
21−
22−To fix this we modify chmod to 0644 just before esphome tries a copy
23−operation, which will fix permissions on existing working directories
24−just in time.
25−---
26− esphome/helpers.py | 4 ++++
27− 1 file changed, 4 insertions(+)
28−
29−diff --git a/esphome/helpers.py b/esphome/helpers.py
30−index ad7b8272..c456f4ff 100644
31−--- a/esphome/helpers.py
32−+++ b/esphome/helpers.py
33−@@ -228,6 +228,10 @@ def copy_file_if_changed(src: os.PathLike, dst: os.PathLike) -> None:
34− if file_compare(src, dst):
35− return
36− mkdir_p(os.path.dirname(dst))
37−+ try:
38−+ os.chmod(dst, 0o644)
39−+ except OSError:
40−+ pass
41− try:
42− shutil.copy(src, dst)
43− except OSError as err:
44−--
45−2.31.1
46−