From 7661181528df06f3b7e15128c1efcb6ac1854f31 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 9 Feb 2019 23:19:53 +0100 Subject: ma google-muell: bump to latest version, use new config --- makefu/2configs/homeautomation/google-muell.nix | 15 +++++++++++---- makefu/5pkgs/ampel/default.nix | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/homeautomation/google-muell.nix b/makefu/2configs/homeautomation/google-muell.nix index 235cc1546..5870f298d 100644 --- a/makefu/2configs/homeautomation/google-muell.nix +++ b/makefu/2configs/homeautomation/google-muell.nix @@ -3,13 +3,20 @@ with import ; let pkg = pkgs.ampel; home = "/var/lib/ampel"; - sec = "${toString }/google-muell.json"; + sec = "${toString }/ampel/google-muell.json"; ampelsec = "${home}/google-muell.json"; - cred = "${toString }/google-muell-creds.json"; + cred = "${toString }/ampel/google-muell-creds.json"; # TODO: generate this credential file locally ampelcred = "${home}/google-muell-creds.json"; - esp = "192.168.8.204"; sleepval = "1800"; + default-color = "244,220,66"; + config_json = toFile "config.json" (toJSON { + mq_hostname = "localhost"; + mq_port = 1883; + mq_username = "sensor"; + mq_topic = "/ham/flurlicht/cmnd/MEM1"; + mq_password = replaceChars ["\n"] [""] (readFile "${toString }/mqtt/sensor"); + }); in { users.users.ampel = { uid = genid "ampel"; @@ -27,7 +34,7 @@ in { install -m600 -o ampel ${sec} ${ampelsec} install -m600 -o ampel ${cred} ${ampelcred} ''; - ExecStart = "${pkg}/bin/google-muell --esp=${esp} --client-secrets=${ampelsec} --credential-path=${ampelcred} --sleepval=${sleepval}"; + ExecStart = "${pkg}/bin/google-muell --config ${config_json} --default-color=${default-color} --client-secrets=${ampelsec} --credential-path=${ampelcred} --sleepval=${sleepval}"; PermissionsStartOnly = true; Restart = "always"; RestartSec = 10; diff --git a/makefu/5pkgs/ampel/default.nix b/makefu/5pkgs/ampel/default.nix index 9792c2c59..70fdfda78 100644 --- a/makefu/5pkgs/ampel/default.nix +++ b/makefu/5pkgs/ampel/default.nix @@ -2,7 +2,7 @@ with pkgs.python3Packages;buildPythonPackage rec { name = "ampel-${version}"; - version = "0.2.1"; + version = "0.2.4"; propagatedBuildInputs = [ docopt @@ -16,8 +16,8 @@ with pkgs.python3Packages;buildPythonPackage rec { src = pkgs.fetchgit { url = "http://cgit.euer.krebsco.de/ampel"; - rev = "92321d7"; - sha256 = "0mvpbpf1rx8sc589qjb73gl8z6fir2zs3gl3br1pbhg5jgn0ij4n"; + rev = "04e1c8c38ffe53175ae719121ad88534a8a662db"; + sha256 = "00jgr3jg2yi91hd7388v8rncfbq8fx8dvr03sg749dzpsg58hfxn"; }; meta = { homepage = http://cgit.euer.krebsco.de/ampel; -- cgit v1.2.3