           (f/parse (f/formatter "y-M-d H:mZ")
                    (s/replace (nth match 1) "T" " "))
           (t/now)))
-       diff-minutes)))
+        diff-minutes)))
 
 (defn get-yc-image
   "Returns the name of the latest yardcam image."

  and having the given location."
  [db-con start end location]
  (try
    (let [query (sql/format (sql/build :select [:temperature
                                                :humidity]
                                       :from :ruuvitag_observations
                                       :where [:and
                                               [:= :location location]
                                               [:>= :recorded start]
                                               [:<= :recorded end]]
                                       :order-by [[:id :asc]]))
          result (j/query db-con query
                          {:row-fn (fn [obs]
                                     {:rt-temperature (:temperature obs)
                                      :rt-humidity (:humidity obs)})})]
      result)
    (catch PSQLException pe
      (log/error "RuuviTag observation fetching failed:"
                 (.getMessage pe))

            [honeysql
             [core :as sql]
             [helpers :refer :all]])
  (:import java.text.NumberFormat
           java.time.ZoneId
           org.postgresql.util.PSQLException))

(let [db-host (get (System/getenv)
