diff options
author | tv <tv@krebsco.de> | 2020-09-08 22:19:15 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2020-09-08 22:19:15 +0200 |
commit | f3aac671f823063f225096984ff8644190cf9b91 (patch) | |
tree | c33c4e9d8da1ba419541950f110f4b4dfbf8155b /makefu/2configs/bureautomation | |
parent | 6fbbf7e6170f6a1ba42c5dcecd11ca67c6bc5afd (diff) | |
parent | 549598bfd9cf6e94f8bb83ebbcc17400069f1198 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/bureautomation')
-rw-r--r-- | makefu/2configs/bureautomation/camera/comic.nix | 4 | ||||
-rw-r--r-- | makefu/2configs/bureautomation/comic-updater.nix | 12 | ||||
-rw-r--r-- | makefu/2configs/bureautomation/default.nix | 7 |
3 files changed, 18 insertions, 5 deletions
diff --git a/makefu/2configs/bureautomation/camera/comic.nix b/makefu/2configs/bureautomation/camera/comic.nix index a847b0add..a523d032e 100644 --- a/makefu/2configs/bureautomation/camera/comic.nix +++ b/makefu/2configs/bureautomation/camera/comic.nix @@ -3,4 +3,8 @@ platform = "generic"; still_image_url = http://127.0.0.1:8123/local/lines.png ; } + { name = "XKCD"; + platform = "generic"; + still_image_url = http://127.0.0.1:8123/local/xkcd.png ; + } ] diff --git a/makefu/2configs/bureautomation/comic-updater.nix b/makefu/2configs/bureautomation/comic-updater.nix index 5f26bc2c7..1e2440939 100644 --- a/makefu/2configs/bureautomation/comic-updater.nix +++ b/makefu/2configs/bureautomation/comic-updater.nix @@ -6,21 +6,29 @@ let in { systemd.services.comic-updater = { startAt = "daily"; - description = "Send led change to message queue"; + description = "update our comics"; after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service"); path = with pkgs; [ wget xmlstarlet ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { User = "hass"; WorkingDirectory = config.services.home-assistant.configDir; - ExecStart = pkgs.writeDash "update-poorly-drawn-lines" '' + ExecStart = pkgs.writeDash "update-comics" '' set -euf mkdir -p www/ cd www/ + # poorly drawn lines pic=$(wget -O- http://www.poorlydrawnlines.com/feed/ \ | xml sel -t -v '/rss/channel/item/content:encoded' \ | head -n 2 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' ) wget "$pic" -nc && cp -v "$(basename "$pic")" lines.png + + #pic=$(curl -L xkcd.com 2>/dev/null | grep imgs.xkcd.com | grep title | sed -n 's/.*src="\([^"]\+\)" .*/https:\1/p') + # xkcd + pic=$(wget -O- https://xkcd.com/rss.xml \ + | xml sel -t -v '/rss/channel/item/description' \ + | head -n 1 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' ) + wget "$pic" -nc && cp -v "$(basename "$pic")" xkcd.png ''; PrivateTmp = true; }; diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index c115bcb6c..9b33595f4 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -137,9 +137,9 @@ in { ++ frosch.binary_sensor ++ aramark.binary_sensor; - sensor = - # [{ platform = "version"; }] ++ # pyhaversion - (import ./sensor/pollen.nix) + sensor = [] + ++ [{ platform = "version"; }] # pyhaversion + ++ (import ./sensor/pollen.nix) ++ (import ./sensor/espeasy.nix) ++ (import ./sensor/airquality.nix) ++ ((import ./sensor/outside.nix) {inherit lib;}) @@ -238,6 +238,7 @@ in { "camera.Autobahn_Singen" "camera.puppies" "camera.poorly_drawn_lines" + "camera.xkcd" ]; nachtlicht = [ "switch.nachtlicht_a" |