Update dependency on notifier
This commit is contained in:
parent
87b8b005b3
commit
3787a37197
5
deps.edn
5
deps.edn
|
@ -5,8 +5,9 @@
|
|||
org.clojure/tools.cli {:mvn/version "1.0.214"}
|
||||
metosin/malli { :mvn/version "0.11.0" }
|
||||
org.fudo/notifier {
|
||||
:git/url "https://git.fudo.org/fudo-public/notifier.git"
|
||||
:git/sha "bda18253fc5f736a3bec36ac9f36ff49e03538e0"
|
||||
:local/root "/nix/store/qqfnbwp1vg3r0ni2sj096pas67drx45l-org.fudo-notifier-0.1.jar"
|
||||
; :git/url "https://git.fudo.org/fudo-public/notifier.git"
|
||||
; :git/sha "bda18253fc5f736a3bec36ac9f36ff49e03538e0"
|
||||
}
|
||||
org.fudo/fudo-clojure {
|
||||
:git/url "https://git.fudo.org/fudo-public/fudo-clojure.git"
|
||||
|
|
14
flake.lock
14
flake.lock
|
@ -271,11 +271,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1684398685,
|
||||
"narHash": "sha256-TRE62m91iZ5ArVMgA+uj22Yda8JoQuuhc9uwZ+NoX+0=",
|
||||
"lastModified": 1684580438,
|
||||
"narHash": "sha256-LUPswmDn6fXP3lEBJFA2Id8PkcYDgzUilevWackYVvQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "628d4bb6e9f4f0c30cfd9b23d3c1cdcec9d3cb5c",
|
||||
"rev": "7dc71aef32e8faf065cb171700792cf8a65c152d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -308,11 +308,11 @@
|
|||
"utils": "utils_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1684439408,
|
||||
"narHash": "sha256-bwDKPzgkjYj7nYgdvKSy3QmbL/fbVQI1A4LxA6JL7Gw=",
|
||||
"lastModified": 1684784801,
|
||||
"narHash": "sha256-7d8blW6tVHMTdgAQB2Dh470XsvWbD5gICwgXrS/90Xg=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "8a26333322a180bf62e7aed01e6d19d748c225d7",
|
||||
"revCount": 8,
|
||||
"rev": "6ff2823f55812d527ce6fd022caf78a438afb371",
|
||||
"revCount": 9,
|
||||
"type": "git",
|
||||
"url": "https://git.fudo.org/fudo-public/notifier.git"
|
||||
},
|
||||
|
|
|
@ -29,17 +29,18 @@
|
|||
topic :topic
|
||||
logger :logger
|
||||
urgency-threshold :urgency-threshold}]
|
||||
(let [note-chan (mqtt/subscribe! mqtt-client topic)]
|
||||
(let [note-chan (mqtt/subscribe! mqtt-client topic)
|
||||
bus (notify/connect-session-bus)]
|
||||
(go-loop [note-msg (<! note-chan)]
|
||||
(if note-msg
|
||||
(let [note (:payload note-msg)]
|
||||
(if (t/validate Notification note)
|
||||
(if (>= (:urgency note) urgency-threshold)
|
||||
(do (log/info! logger (format "notification: %s" (:summary note)))
|
||||
(notify/send-notification! mqtt-client
|
||||
(-> note
|
||||
(assoc :app app)
|
||||
(update :urgency codify-urgency))))
|
||||
(notify/send-notification! bus
|
||||
(-> note
|
||||
(assoc :app app)
|
||||
(update :urgency codify-urgency))))
|
||||
(log/info! logger (format "ignoring low-urgency message (%s < %s): %s"
|
||||
(:urgency note)
|
||||
urgency-threshold
|
||||
|
|
Loading…
Reference in New Issue