Merge pull request #181411 from NixOS/home-assistant

home-assistant: 2022.7.3 -> 2022.7.4
This commit is contained in:
Martin Weinelt 2022-07-14 10:51:45 +02:00 committed by GitHub
commit 37a52d22b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 24 deletions

View file

@ -7,8 +7,6 @@ in {
meta.maintainers = lib.teams.home-assistant.members; meta.maintainers = lib.teams.home-assistant.members;
nodes.hass = { pkgs, ... }: { nodes.hass = { pkgs, ... }: {
environment.systemPackages = with pkgs; [ mosquitto ];
services.postgresql = { services.postgresql = {
enable = true; enable = true;
ensureDatabases = [ "hass" ]; ensureDatabases = [ "hass" ];
@ -108,9 +106,7 @@ in {
# Cause a configuration change that requires a service restart as we added a new runtime dependency # Cause a configuration change that requires a service restart as we added a new runtime dependency
specialisation.newFeature = { specialisation.newFeature = {
inheritParentConfig = true; inheritParentConfig = true;
configuration.services.home-assistant.config.device_tracker = [ configuration.services.home-assistant.config.esphome = {};
{ platform = "bluetooth_tracker"; }
];
}; };
}; };
@ -119,6 +115,7 @@ in {
in in
'' ''
import re import re
import json
start_all() start_all()
@ -131,7 +128,19 @@ in {
assert match assert match
package = match.group('path') package = match.group('path')
def get_journal_cursor(host) -> str:
exit, out = host.execute("journalctl -u home-assistant.service -n1 -o json-pretty --output-fields=__CURSOR")
assert exit == 0
return json.loads(out)["__CURSOR"]
def wait_for_homeassistant(host, cursor):
host.wait_until_succeeds(f"journalctl --after-cursor='{cursor}' -u home-assistant.service | grep -q 'Home Assistant initialized in'")
hass.wait_for_unit("home-assistant.service") hass.wait_for_unit("home-assistant.service")
cursor = get_journal_cursor(hass)
with subtest("Check that YAML configuration file is in place"): with subtest("Check that YAML configuration file is in place"):
hass.succeed("test -L ${configDir}/configuration.yaml") hass.succeed("test -L ${configDir}/configuration.yaml")
@ -148,7 +157,7 @@ in {
hass.succeed(f"grep -q 'wake_on_lan' {package}/extra_components") hass.succeed(f"grep -q 'wake_on_lan' {package}/extra_components")
with subtest("Check that Home Assistant's web interface and API can be reached"): with subtest("Check that Home Assistant's web interface and API can be reached"):
hass.wait_until_succeeds("journalctl -u home-assistant.service | grep -q 'Home Assistant initialized in'") wait_for_homeassistant(hass, cursor)
hass.wait_for_open_port(8123) hass.wait_for_open_port(8123)
hass.succeed("curl --fail http://localhost:8123/lovelace") hass.succeed("curl --fail http://localhost:8123/lovelace")
@ -162,15 +171,19 @@ in {
with subtest("Check service reloads when configuration changes"): with subtest("Check service reloads when configuration changes"):
# store the old pid of the process # store the old pid of the process
pid = hass.succeed("systemctl show --property=MainPID home-assistant.service") pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
cursor = get_journal_cursor(hass)
hass.succeed("${system}/specialisation/differentName/bin/switch-to-configuration test") hass.succeed("${system}/specialisation/differentName/bin/switch-to-configuration test")
new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service") new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
assert pid == new_pid, "The PID of the process should not change between process reloads" assert pid == new_pid, "The PID of the process should not change between process reloads"
wait_for_homeassistant(hass, cursor)
with subtest("check service restarts when package changes"): with subtest("check service restarts when package changes"):
pid = new_pid pid = new_pid
cursor = get_journal_cursor(hass)
hass.succeed("${system}/specialisation/newFeature/bin/switch-to-configuration test") hass.succeed("${system}/specialisation/newFeature/bin/switch-to-configuration test")
new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service") new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
assert pid != new_pid, "The PID of the process shoudl change when the HA binary changes" assert pid != new_pid, "The PID of the process shoudl change when the HA binary changes"
wait_for_homeassistant(hass, cursor)
with subtest("Check that no errors were logged"): with subtest("Check that no errors were logged"):
output_log = hass.succeed("cat ${configDir}/home-assistant.log") output_log = hass.succeed("cat ${configDir}/home-assistant.log")

View file

@ -17,14 +17,14 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "bellows"; pname = "bellows";
version = "0.31.0"; version = "0.31.1";
format = "setuptools"; format = "setuptools";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "zigpy"; owner = "zigpy";
repo = "bellows"; repo = "bellows";
rev = "refs/tags/${version}"; rev = "refs/tags/${version}";
sha256 = "sha256-8pw139TNY7LE7x13JfgxcUVWFIXVj4FiEvqdUh+xcl8="; sha256 = "sha256-kjZL6N1VF3Rc26eB5fU1UEs9BEr4sfV4Hto6QdwqeqY=";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [

View file

@ -2,7 +2,7 @@
# Do not edit! # Do not edit!
{ {
version = "2022.7.3"; version = "2022.7.4";
components = { components = {
"abode" = ps: with ps; [ "abode" = ps: with ps; [
abodepy abodepy

View file

@ -85,19 +85,6 @@ let
}); });
}) })
# Pinned due to API changes in pyruckus>0.12
(self: super: {
pyruckus = super.pyruckus.overridePythonAttrs (oldAttrs: rec {
version = "0.12";
src = fetchFromGitHub {
owner = "gabe565";
repo = "pyruckus";
rev = version;
sha256 = "0ykv6r6blbj3fg9fplk9i7xclkv5d93rwvx0fm5s8ms9f2s9ih8z";
};
});
})
# Pinned due to API changes in 0.1.0 # Pinned due to API changes in 0.1.0
(mkOverride "poolsense" "0.0.8" "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=") (mkOverride "poolsense" "0.0.8" "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=")
@ -190,7 +177,7 @@ let
extraPackagesFile = writeText "home-assistant-packages" (lib.concatMapStringsSep "\n" (pkg: pkg.pname) extraBuildInputs); extraPackagesFile = writeText "home-assistant-packages" (lib.concatMapStringsSep "\n" (pkg: pkg.pname) extraBuildInputs);
# Don't forget to run parse-requirements.py after updating # Don't forget to run parse-requirements.py after updating
hassVersion = "2022.7.3"; hassVersion = "2022.7.4";
in python.pkgs.buildPythonApplication rec { in python.pkgs.buildPythonApplication rec {
pname = "homeassistant"; pname = "homeassistant";
@ -208,7 +195,7 @@ in python.pkgs.buildPythonApplication rec {
owner = "home-assistant"; owner = "home-assistant";
repo = "core"; repo = "core";
rev = version; rev = version;
hash = "sha256-e0vu3QUalFncWloNum92YLvMWkeuFF74vrNdfmsfEw0="; hash = "sha256-TQsIChMoIlTd8+gN4bxiWFId6V2wB1j3XfhXYpYMw9M=";
}; };
# leave this in, so users don't have to constantly update their downstream patch handling # leave this in, so users don't have to constantly update their downstream patch handling