about summary refs log tree commit diff
path: root/pkgs/tools/misc/esphome
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/esphome')
-rw-r--r--pkgs/tools/misc/esphome/dashboard.nix9
-rw-r--r--pkgs/tools/misc/esphome/default.nix12
-rw-r--r--pkgs/tools/misc/esphome/fix-src-permissions.patch46
3 files changed, 8 insertions, 59 deletions
diff --git a/pkgs/tools/misc/esphome/dashboard.nix b/pkgs/tools/misc/esphome/dashboard.nix
index 43f71c2d69ee8..dfb61ca29ad9b 100644
--- a/pkgs/tools/misc/esphome/dashboard.nix
+++ b/pkgs/tools/misc/esphome/dashboard.nix
@@ -1,14 +1,15 @@
 { lib
-, python3
+, buildPythonPackage
+, fetchPypi
 }:
 
-with python3.pkgs; buildPythonPackage rec {
+buildPythonPackage rec {
   pname = "esphome-dashboard";
-  version = "20211211.0";
+  version = "20220209.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "sha256-xF1/gUJCr4qRO+AnWeFO6b1YnQBOgve/23ZaGmCa910=";
+    sha256 = "sha256-FkFu3SvsowcsOFXvqWmpY3KEypXSb6KcpC/nJbQpDBA=";
   };
 
   # no tests
diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix
index d1b00e74ef7f4..444e0e122ef1d 100644
--- a/pkgs/tools/misc/esphome/default.nix
+++ b/pkgs/tools/misc/esphome/default.nix
@@ -1,5 +1,4 @@
 { lib
-, pkgs
 , python3
 , fetchFromGitHub
 , fetchpatch
@@ -11,27 +10,22 @@
 let
   python = python3.override {
     packageOverrides = self: super: {
-      esphome-dashboard = pkgs.callPackage ./dashboard.nix {};
+      esphome-dashboard = self.callPackage ./dashboard.nix {};
     };
   };
 in
 with python.pkgs; buildPythonApplication rec {
   pname = "esphome";
-  version = "2021.12.2";
+  version = "2022.2.3";
   format = "setuptools";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = version;
-    sha256 = "sha256-Uq+VzU/j14+3LegEA9bQ1JGe5tUBuP0IX34LdritJdA=";
+    sha256 = "sha256-Pt57wI1cYTqT65zGOk1/GyvK0BqITxCzWIyXSNZ9D/0=";
   };
 
-  patches = [
-    # fix missing write permissions on src files before modifing them
-    ./fix-src-permissions.patch
-  ];
-
   postPatch = ''
     # remove all version pinning (E.g tornado==5.1.1 -> tornado)
     sed -i -e "s/==[0-9.]*//" requirements.txt
diff --git a/pkgs/tools/misc/esphome/fix-src-permissions.patch b/pkgs/tools/misc/esphome/fix-src-permissions.patch
deleted file mode 100644
index 5e92350105dd4..0000000000000
--- a/pkgs/tools/misc/esphome/fix-src-permissions.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From f72c5035944065941daaa236b60664657c777726 Mon Sep 17 00:00:00 2001
-From: Martin Weinelt <hexa@darmstadt.ccc.de>
-Date: Wed, 23 Jun 2021 04:50:35 +0200
-Subject: [PATCH] Set u+w for copied src files before trying to overwrite them
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-We store esphome in the nix store, which results in its file permissions
-being 0444. Esphome, when compiling a firmware image, will copy these
-files from the nix store to a working directory. When updating between
-versions it will notice these files changed and try to copy the new
-version over, which would break, because the user had no write
-permissions on the files.
-
-❯ esphome compile 01e4ac.yml
-INFO Reading configuration 01e4ac.yml...
-INFO Detected timezone 'CET' with UTC offset 1 and daylight saving time from 27 March 02:00:00 to 30 October 03:00:00
-INFO Generating C++ source...
-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'
-
-To fix this we modify chmod to 0644 just before esphome tries a copy
-operation, which will fix permissions on existing working directories
-just in time.
----
- esphome/helpers.py | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/esphome/helpers.py b/esphome/helpers.py
-index ad7b8272..c456f4ff 100644
---- a/esphome/helpers.py
-+++ b/esphome/helpers.py
-@@ -228,6 +228,10 @@ def copy_file_if_changed(src: os.PathLike, dst: os.PathLike) -> None:
-     if file_compare(src, dst):
-         return
-     mkdir_p(os.path.dirname(dst))
-+    try:
-+        os.chmod(dst, 0o644)
-+    except OSError:
-+        pass
-     try:
-         shutil.copy(src, dst)
-     except OSError as err:
--- 
-2.31.1
-