summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amat.us>2017-04-22 12:22:46 -0500
committerDavid Barksdale <amatus@amat.us>2017-04-22 12:22:46 -0500
commit897507bf1441c5b02973e56b30eefed87b00fb0a (patch)
treeb372608874f97e2e28e3ec3de9c3a0360b1eb714
parentbe0cb8f8897725a21a1594c0f53f64f6915ea367 (diff)
Call init for temperature and portmaster
-rw-r--r--src/app/handler.clj12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/app/handler.clj b/src/app/handler.clj
index 22b2d2d..fdf722e 100644
--- a/src/app/handler.clj
+++ b/src/app/handler.clj
@@ -1,5 +1,7 @@
(ns app.handler
- (:require [castra.middleware :as castra]
+ (:require [app.portmaster :as pm]
+ [app.temperature :as temp]
+ [castra.middleware :as castra]
[compojure.core :as c]
[compojure.route :as route]
[ring.middleware.defaults :as d]
@@ -16,3 +18,11 @@
(d/wrap-defaults d/api-defaults)))
(db/init)
+
+(let [{:keys [init port-name username password]} (db/get :portmaster)]
+ (when init
+ (pm/init port-name username password)))
+
+(let [{:keys [init]} (db/get :temperature)]
+ (when init
+ (temp/init)))