 (defn update-sensor-selection [selected-sensors unit chart sensors history]
   (om/update! sensors :selected selected-sensors)
   (om/update! chart :sensor selected-sensors)
-  (om/update! chart :unit unit)
+  (om/update! chart :unit (if (seq selected-sensors) unit ""))
   (om/update! chart :message "")
   (history/update-token-ids! history :sensors (if (seq selected-sensors)
                                                 (string/join ";" selected-sensors)


(defn chart-feedback-box [cursor owner]
  (om/component
   (dom/div nil cursor)))

(defn flatten-device [device]
  (let [device-keys   (->> device keys (remove #(= % :readings)))

            [:div {:id "chart-div" :class (if editing "hidden" "")}
             [:div {:id "date-picker"}
              (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
             (om/build chart-feedback-box (get-in data [:chart]))
             (om/build chart-summary (:chart data))
             [:div.col-md-12.well
              [:div#chart {:style {:width "100%" :height 600}}
