about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/home-assistant/patches
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-01-03 23:55:00 +0000
committerAlyssa Ross <hi@alyssa.is>2022-02-19 11:03:39 +0000
commitf4cf97a04cd5d0b86aa46baec9fb228a8f671c03 (patch)
tree28192415ff39a661d0001563bf81cc93fa25d16d /nixpkgs/pkgs/servers/home-assistant/patches
parentf8422837c9bde058e8f2de37702e7e94b2226040 (diff)
parent18c84ea816348e2a098390101b92d1e39a9dbd45 (diff)
downloadnixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.gz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.bz2
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.lz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.xz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.zst
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.zip
Merge commit '18c84ea816348e2a098390101b92d1e39a9dbd45'
Conflicts:
	nixpkgs/nixos/modules/misc/documentation.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
	nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
	nixpkgs/pkgs/development/python-modules/django-mailman3/default.nix
	nixpkgs/pkgs/servers/mail/mailman/web.nix
	nixpkgs/pkgs/top-level/aliases.nix
	nixpkgs/pkgs/top-level/all-packages.nix
	nixpkgs/pkgs/top-level/impure.nix
Diffstat (limited to 'nixpkgs/pkgs/servers/home-assistant/patches')
-rw-r--r--nixpkgs/pkgs/servers/home-assistant/patches/ffmpeg-path.patch84
-rw-r--r--nixpkgs/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch27
-rw-r--r--nixpkgs/pkgs/servers/home-assistant/patches/tests-mock-source-ip.patch13
3 files changed, 124 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/home-assistant/patches/ffmpeg-path.patch b/nixpkgs/pkgs/servers/home-assistant/patches/ffmpeg-path.patch
new file mode 100644
index 000000000000..a72674ff7a5f
--- /dev/null
+++ b/nixpkgs/pkgs/servers/home-assistant/patches/ffmpeg-path.patch
@@ -0,0 +1,84 @@
+diff --git a/homeassistant/components/ffmpeg/__init__.py b/homeassistant/components/ffmpeg/__init__.py
+index 74c826f47d..91f359da2a 100644
+--- a/homeassistant/components/ffmpeg/__init__.py
++++ b/homeassistant/components/ffmpeg/__init__.py
+@@ -40,7 +40,7 @@ CONF_FFMPEG_BIN = "ffmpeg_bin"
+ CONF_EXTRA_ARGUMENTS = "extra_arguments"
+ CONF_OUTPUT = "output"
+ 
+-DEFAULT_BINARY = "ffmpeg"
++DEFAULT_BINARY = "@ffmpeg@"
+ 
+ CONFIG_SCHEMA = vol.Schema(
+     {
+diff --git a/tests/components/ffmpeg/test_init.py b/tests/components/ffmpeg/test_init.py
+index e1730ffdab..e9cd7934fd 100644
+--- a/tests/components/ffmpeg/test_init.py
++++ b/tests/components/ffmpeg/test_init.py
+@@ -87,7 +87,7 @@ class TestFFmpegSetup:
+         with assert_setup_component(1):
+             setup_component(self.hass, ffmpeg.DOMAIN, {ffmpeg.DOMAIN: {}})
+ 
+-        assert self.hass.data[ffmpeg.DATA_FFMPEG].binary == "ffmpeg"
++        assert self.hass.data[ffmpeg.DATA_FFMPEG].binary == "@ffmpeg@"
+ 
+     def test_setup_component_test_service(self):
+         """Set up ffmpeg component test services."""
+diff --git a/tests/components/ffmpeg/test_sensor.py b/tests/components/ffmpeg/test_sensor.py
+index a6c9c1f441..f13091da1a 100644
+--- a/tests/components/ffmpeg/test_sensor.py
++++ b/tests/components/ffmpeg/test_sensor.py
+@@ -27,7 +27,7 @@ class TestFFmpegNoiseSetup:
+             setup_component(self.hass, "binary_sensor", self.config)
+         self.hass.block_till_done()
+ 
+-        assert self.hass.data["ffmpeg"].binary == "ffmpeg"
++        assert self.hass.data["ffmpeg"].binary == "@ffmpeg@"
+         assert self.hass.states.get("binary_sensor.ffmpeg_noise") is not None
+ 
+     @patch("haffmpeg.sensor.SensorNoise.open_sensor", return_value=mock_coro())
+@@ -37,7 +37,7 @@ class TestFFmpegNoiseSetup:
+             setup_component(self.hass, "binary_sensor", self.config)
+         self.hass.block_till_done()
+ 
+-        assert self.hass.data["ffmpeg"].binary == "ffmpeg"
++        assert self.hass.data["ffmpeg"].binary == "@ffmpeg@"
+         assert self.hass.states.get("binary_sensor.ffmpeg_noise") is not None
+ 
+         self.hass.start()
+@@ -53,7 +53,7 @@ class TestFFmpegNoiseSetup:
+             setup_component(self.hass, "binary_sensor", self.config)
+         self.hass.block_till_done()
+ 
+-        assert self.hass.data["ffmpeg"].binary == "ffmpeg"
++        assert self.hass.data["ffmpeg"].binary == "@ffmpeg@"
+         assert self.hass.states.get("binary_sensor.ffmpeg_noise") is not None
+ 
+         self.hass.start()
+@@ -89,7 +89,7 @@ class TestFFmpegMotionSetup:
+             setup_component(self.hass, "binary_sensor", self.config)
+         self.hass.block_till_done()
+ 
+-        assert self.hass.data["ffmpeg"].binary == "ffmpeg"
++        assert self.hass.data["ffmpeg"].binary == "@ffmpeg@"
+         assert self.hass.states.get("binary_sensor.ffmpeg_motion") is not None
+ 
+     @patch("haffmpeg.sensor.SensorMotion.open_sensor", return_value=mock_coro())
+@@ -99,7 +99,7 @@ class TestFFmpegMotionSetup:
+             setup_component(self.hass, "binary_sensor", self.config)
+         self.hass.block_till_done()
+ 
+-        assert self.hass.data["ffmpeg"].binary == "ffmpeg"
++        assert self.hass.data["ffmpeg"].binary == "@ffmpeg@"
+         assert self.hass.states.get("binary_sensor.ffmpeg_motion") is not None
+ 
+         self.hass.start()
+@@ -115,7 +115,7 @@ class TestFFmpegMotionSetup:
+             setup_component(self.hass, "binary_sensor", self.config)
+         self.hass.block_till_done()
+ 
+-        assert self.hass.data["ffmpeg"].binary == "ffmpeg"
++        assert self.hass.data["ffmpeg"].binary == "@ffmpeg@"
+         assert self.hass.states.get("binary_sensor.ffmpeg_motion") is not None
+ 
+         self.hass.start()
diff --git a/nixpkgs/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch b/nixpkgs/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch
new file mode 100644
index 000000000000..add0ea1d5521
--- /dev/null
+++ b/nixpkgs/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch
@@ -0,0 +1,27 @@
+From 3e3f5c37252a33ea1e71c39f2ca0f13940c261ad Mon Sep 17 00:00:00 2001
+From: Martin Weinelt <hexa@darmstadt.ccc.de>
+Date: Sat, 17 Jul 2021 16:11:23 +0200
+Subject: [PATCH] tests: ignore OSErrors in hass fixture
+
+The nix sandbox will cause OSErrors due to limitations imposed on
+network interaction. This change makes it so we forgive these cases.
+---
+ tests/conftest.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 1f5ffc80d0..b284727a0f 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -168,6 +168,8 @@ def hass(loop, load_registries, hass_storage, request):
+             continue
+         if isinstance(ex, ServiceNotFound):
+             continue
++        if isinstance(ex, OSError):
++            continue
+         raise ex
+ 
+ 
+-- 
+2.32.0
+
diff --git a/nixpkgs/pkgs/servers/home-assistant/patches/tests-mock-source-ip.patch b/nixpkgs/pkgs/servers/home-assistant/patches/tests-mock-source-ip.patch
new file mode 100644
index 000000000000..4094d08ee7ff
--- /dev/null
+++ b/nixpkgs/pkgs/servers/home-assistant/patches/tests-mock-source-ip.patch
@@ -0,0 +1,13 @@
+diff --git a/homeassistant/components/network/__init__.py b/homeassistant/components/network/__init__.py
+index 7cc864727d..69333a5454 100644
+--- a/homeassistant/components/network/__init__.py
++++ b/homeassistant/components/network/__init__.py
+@@ -26,7 +26,7 @@ async def async_get_source_ip(
+ ) -> str:
+     """Get the source ip for a target ip."""
+     adapters = await async_get_adapters(hass)
+-    all_ipv4s = []
++    all_ipv4s = ["127.0.0.1"]
+     for adapter in adapters:
+         if adapter["enabled"] and (ipv4s := adapter["ipv4"]):
+             all_ipv4s.extend([ipv4["address"] for ipv4 in ipv4s])