diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix index 0c027eaca619..2d74b59bca46 100644 --- a/nixos/tests/home-assistant.nix +++ b/nixos/tests/home-assistant.nix @@ -2,7 +2,8 @@ import ./make-test.nix ({ pkgs, ... }: let configDir = "/var/lib/foobar"; - apiPassword = "secret"; + apiPassword = "some_secret"; + mqttPassword = "another_secret"; in { name = "home-assistant"; @@ -33,7 +34,9 @@ in { }; frontend = { }; http.api_password = apiPassword; - mqtt = { }; # Use hbmqtt as broker + mqtt = { # Use hbmqtt as broker + password = mqttPassword; + }; binary_sensor = [ { platform = "mqtt"; @@ -62,7 +65,7 @@ in { # Toggle a binary sensor using MQTT $hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"off\"'"); - $hass->waitUntilSucceeds("mosquitto_pub -V mqttv311 -t home-assistant/test -u homeassistant -P '${apiPassword}' -m let_there_be_light"); + $hass->waitUntilSucceeds("mosquitto_pub -V mqttv311 -t home-assistant/test -u homeassistant -P '${mqttPassword}' -m let_there_be_light"); $hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"on\"'"); # Print log to ease debugging diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 30b16ea3bde6..bc389146e756 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 = "0.75.2"; + version = "0.76.1"; components = { "abode" = ps: with ps; [ ]; "ads" = ps: with ps; [ ]; @@ -112,6 +112,7 @@ "binary_sensor.netatmo" = ps: with ps; [ ]; "binary_sensor.nx584" = ps: with ps; [ ]; "binary_sensor.octoprint" = ps: with ps; [ ]; + "binary_sensor.openuv" = ps: with ps; [ ]; "binary_sensor.pilight" = ps: with ps; [ ]; "binary_sensor.ping" = ps: with ps; [ ]; "binary_sensor.qwikswitch" = ps: with ps; [ ]; @@ -337,6 +338,7 @@ "device_tracker.owntracks" = ps: with ps; [ libnacl paho-mqtt ]; "device_tracker.owntracks_http" = ps: with ps; [ aiohttp-cors libnacl ]; "device_tracker.ping" = ps: with ps; [ ]; + "device_tracker.ritassist" = ps: with ps; [ ]; "device_tracker.sky_hub" = ps: with ps; [ ]; "device_tracker.snmp" = ps: with ps; [ pysnmp ]; "device_tracker.swisscom" = ps: with ps; [ ]; @@ -383,7 +385,6 @@ "fan.mqtt" = ps: with ps; [ paho-mqtt ]; "fan.template" = ps: with ps; [ ]; "fan.tuya" = ps: with ps; [ ]; - "fan.velbus" = ps: with ps; [ ]; "fan.wink" = ps: with ps; [ ]; "fan.xiaomi_miio" = ps: with ps; [ construct ]; "fan.zha" = ps: with ps; [ ]; @@ -536,7 +537,6 @@ "light.tplink" = ps: with ps; [ ]; "light.tradfri" = ps: with ps; [ ]; "light.tuya" = ps: with ps; [ ]; - "light.velbus" = ps: with ps; [ ]; "light.vera" = ps: with ps; [ ]; "light.wemo" = ps: with ps; [ ]; "light.wink" = ps: with ps; [ ]; @@ -600,6 +600,7 @@ "media_player.denon" = ps: with ps; [ ]; "media_player.denonavr" = ps: with ps; [ ]; "media_player.directv" = ps: with ps; [ ]; + "media_player.dlna_dmr" = ps: with ps; [ ]; "media_player.dunehd" = ps: with ps; [ ]; "media_player.emby" = ps: with ps; [ ]; "media_player.epson" = ps: with ps; [ ]; @@ -625,6 +626,7 @@ "media_player.pandora" = ps: with ps; [ pexpect ]; "media_player.philips_js" = ps: with ps; [ ]; "media_player.pioneer" = ps: with ps; [ ]; + "media_player.pjlink" = ps: with ps; [ ]; "media_player.plex" = ps: with ps; [ ]; "media_player.roku" = ps: with ps; [ ]; "media_player.russound_rio" = ps: with ps; [ ]; @@ -691,7 +693,7 @@ "notify.gntp" = ps: with ps; [ ]; "notify.group" = ps: with ps; [ ]; "notify.hipchat" = ps: with ps; [ ]; - "notify.html5" = ps: with ps; [ pyjwt aiohttp-cors ]; + "notify.html5" = ps: with ps; [ aiohttp-cors ]; "notify.instapush" = ps: with ps; [ ]; "notify.ios" = ps: with ps; [ aiohttp-cors zeroconf ]; "notify.joaoapps_join" = ps: with ps; [ ]; @@ -723,7 +725,6 @@ "notify.synology_chat" = ps: with ps; [ ]; "notify.syslog" = ps: with ps; [ ]; "notify.telegram" = ps: with ps; [ python-telegram-bot ]; - "notify.telstra" = ps: with ps; [ ]; "notify.twilio_call" = ps: with ps; [ aiohttp-cors twilio ]; "notify.twilio_sms" = ps: with ps; [ aiohttp-cors twilio ]; "notify.twitter" = ps: with ps; [ ]; @@ -736,6 +737,7 @@ "onboarding" = ps: with ps; [ aiohttp-cors ]; "onboarding.const" = ps: with ps; [ ]; "onboarding.views" = ps: with ps; [ ]; + "openuv" = ps: with ps; [ ]; "panel_custom" = ps: with ps; [ aiohttp-cors ]; "panel_iframe" = ps: with ps; [ aiohttp-cors ]; "persistent_notification" = ps: with ps; [ ]; @@ -850,6 +852,7 @@ "sensor.eliqonline" = ps: with ps; [ ]; "sensor.emoncms" = ps: with ps; [ ]; "sensor.enocean" = ps: with ps; [ ]; + "sensor.enphase_envoy" = ps: with ps; [ ]; "sensor.envirophat" = ps: with ps; [ ]; "sensor.envisalink" = ps: with ps; [ ]; "sensor.etherscan" = ps: with ps; [ ]; @@ -942,6 +945,7 @@ "sensor.openexchangerates" = ps: with ps; [ ]; "sensor.openhardwaremonitor" = ps: with ps; [ ]; "sensor.opensky" = ps: with ps; [ ]; + "sensor.openuv" = ps: with ps; [ ]; "sensor.openweathermap" = ps: with ps; [ pyowm ]; "sensor.otp" = ps: with ps; [ ]; "sensor.pi_hole" = ps: with ps; [ ]; @@ -965,6 +969,7 @@ "sensor.rfxtrx" = ps: with ps; [ ]; "sensor.ring" = ps: with ps; [ ]; "sensor.ripple" = ps: with ps; [ ]; + "sensor.rmvtransport" = ps: with ps; [ ]; "sensor.sabnzbd" = ps: with ps; [ ]; "sensor.scrape" = ps: with ps; [ beautifulsoup4 ]; "sensor.season" = ps: with ps; [ ephem ]; @@ -1085,6 +1090,7 @@ "switch.bbb_gpio" = ps: with ps; [ ]; "switch.broadlink" = ps: with ps; [ ]; "switch.command_line" = ps: with ps; [ ]; + "switch.deconz" = ps: with ps; [ ]; "switch.deluge" = ps: with ps; [ deluge-client ]; "switch.demo" = ps: with ps; [ ]; "switch.digital_ocean" = ps: with ps; [ digital-ocean ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 5446398aa8b0..9950c7bb81b1 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -6,60 +6,59 @@ # Additional packages to add to propagatedBuildInputs , extraPackages ? ps: [] +# Override Python packages using +# self: super: { pkg = super.pkg.overridePythonAttrs (oldAttrs: { ... }); } +# Applied after defaultOverrides +, packageOverrides ? self: super: { } + # Skip pip install of required packages on startup , skipPip ? true }: let - py = python3.override { + defaultOverrides = [ # Override the version of some packages pinned in Home Assistant's setup.py - packageOverrides = self: super: { - aiohttp = super.aiohttp.overridePythonAttrs (oldAttrs: rec { - version = "3.3.2"; + (mkOverride "aiohttp" "3.3.2" + "f20deec7a3fbaec7b5eb7ad99878427ad2ee4cc16a46732b705e8121cbb3cc12") + (mkOverride "astral" "1.6.1" + "ab0c08f2467d35fcaeb7bad15274743d3ac1ad18b5391f64a0058a9cd192d37d") + (mkOverride "attrs" "18.1.0" + "e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b") + (mkOverride "pyjwt" "1.6.4" + "4ee413b357d53fd3fb44704577afac88e72e878716116270d722723d65b42176") + (mkOverride "cryptography" "2.3.1" + "8d10113ca826a4c29d5b85b2c4e045ffa8bad74fb525ee0eceb1d38d4c70dfd6") + (mkOverride "cryptography_vectors" "2.3.1" # required by cryptography==2.3.1 + "bf4d9b61dce69c49e830950aa36fad194706463b0b6dfe81425b9e0bc6644d46") + (mkOverride "requests" "2.19.1" + "ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a") + (mkOverride "voluptuous" "0.11.5" + "567a56286ef82a9d7ae0628c5842f65f516abcb496e74f3f59f1d7b28df314ef") + + # used by check_config script + # can be unpinned once https://github.com/home-assistant/home-assistant/issues/11917 is resolved + (mkOverride "colorlog" "3.1.4" + "418db638c9577f37f0fae4914074f395847a728158a011be2a193ac491b9779d") + + # hass-frontend does not exist in python3.pkgs + (self: super: { + hass-frontend = self.callPackage ./frontend.nix { }; + }) + ]; + + mkOverride = attrname: version: sha256: + self: super: { + ${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: { + inherit version; src = oldAttrs.src.override { - inherit version; - sha256 = "f20deec7a3fbaec7b5eb7ad99878427ad2ee4cc16a46732b705e8121cbb3cc12"; + inherit version sha256; }; }); - requests = super.requests.overridePythonAttrs (oldAttrs: rec { - version = "2.19.1"; - src = oldAttrs.src.override { - inherit version; - sha256 = "ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"; - }; - }); - voluptuous = super.voluptuous.overridePythonAttrs (oldAttrs: rec { - version = "0.11.5"; - src = oldAttrs.src.override { - inherit version; - sha256 = "567a56286ef82a9d7ae0628c5842f65f516abcb496e74f3f59f1d7b28df314ef"; - }; - }); - attrs = super.attrs.overridePythonAttrs (oldAttrs: rec { - version = "18.1.0"; - src = oldAttrs.src.override { - inherit version; - sha256 = "e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"; - }; - }); - astral = super.astral.overridePythonAttrs (oldAttrs: rec { - version = "1.6.1"; - src = oldAttrs.src.override { - inherit version; - sha256 = "ab0c08f2467d35fcaeb7bad15274743d3ac1ad18b5391f64a0058a9cd192d37d"; - }; - }); - # used by check_config script - # can be unpinned once https://github.com/home-assistant/home-assistant/issues/11917 is resolved - colorlog = super.colorlog.overridePythonAttrs (oldAttrs: rec { - version = "3.1.4"; - src = oldAttrs.src.override { - inherit version; - sha256 = "418db638c9577f37f0fae4914074f395847a728158a011be2a193ac491b9779d"; - }; - }); - hass-frontend = super.callPackage ./frontend.nix { }; }; + + py = python3.override { + # Put packageOverrides at the start so they are applied after defaultOverrides + packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([ packageOverrides ] ++ defaultOverrides); }; componentPackages = import ./component-packages.nix; @@ -74,7 +73,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "0.75.2"; + hassVersion = "0.76.1"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -89,12 +88,12 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "home-assistant"; rev = version; - sha256 = "1ib76wz3f6jfi7a0w2v561g8vf5w4p2b2d79667api6ynvbw2l9d"; + sha256 = "0bqvb6wsbv1irp92ijdvx62vqicsqhyk301ixf8yb2d1dwwwmid3"; }; propagatedBuildInputs = [ # From setup.py - requests pyyaml pytz pip jinja2 voluptuous typing aiohttp async-timeout astral certifi attrs + aiohttp astral async-timeout attrs certifi jinja2 pyjwt cryptography pip pytz pyyaml requests voluptuous # From http, frontend, recorder and config.config_entries components sqlalchemy aiohttp-cors hass-frontend voluptuous-serialize ] ++ componentBuildInputs ++ extraBuildInputs; diff --git a/pkgs/servers/home-assistant/frontend.nix b/pkgs/servers/home-assistant/frontend.nix index 864a91683eea..e73b239bb05d 100644 --- a/pkgs/servers/home-assistant/frontend.nix +++ b/pkgs/servers/home-assistant/frontend.nix @@ -2,11 +2,11 @@ buildPythonPackage rec { pname = "home-assistant-frontend"; - version = "20180804.0"; + version = "20180818.0"; src = fetchPypi { inherit pname version; - sha256 = "50a9e74efe2b56fbc34fba07205829e0ea77315183e85c235d177cabff3b62ee"; + sha256 = "b6101c342e49c943c59e3525d6741cd3a23af94b65549d59bdeee8cf3f07b294"; }; propagatedBuildInputs = [ user-agents ]; diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 068b89d9a9fe..95b731926984 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -1,5 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ requests pyyaml pytz pip jinja2 voluptuous typing aiohttp async-timeout astral certifi attrs ])" +#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ aiohttp astral async-timeout attrs certifi jinja2 pyjwt cryptography pip pytz pyyaml requests voluptuous ])" # # This script downloads Home Assistant's source tarball. # Inside the homeassistant/components directory, each component has an associated .py file,