summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-08-12 14:38:00 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-08-12 14:56:02 +0200
commit7147260bee9b270209b596e3aa96a669b1092139 (patch)
tree39c31b45c4ab91e7074090af84459dc0d4b58614 /app
parentc27c55fad9cd1fbf0d27ebcd919b78f59c4cbbb0 (diff)
fix: fix rate sensor
Fixes `net` and `io` sensors not showing any values.
Diffstat (limited to 'app')
-rw-r--r--app/Sensor.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Sensor.hs b/app/Sensor.hs
index 9ef38d0..8bfed22 100644
--- a/app/Sensor.hs
+++ b/app/Sensor.hs
@@ -139,9 +139,9 @@ maxS sf = S.feedbackS 0 $ proc ((), xMax) -> do
returnA -< (if xMax <= 0 then 0 else x / xMax', xMax')
rate :: (Monad m, Num a) => S.Sensor m () a -> S.Sensor m () a
-rate sf = S.feedbackS 0 $ proc ((), x') -> do
+rate sf = S.feedbackS Nothing $ proc ((), x') -> do
x <- sf -< ()
- returnA -< (x - x', x)
+ returnA -< (maybe 0 ((-) x) x', Just x)
data NetStat = NetStat deriving (Show)