From 7147260bee9b270209b596e3aa96a669b1092139 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 12 Aug 2024 14:38:00 +0200 Subject: fix: fix rate sensor Fixes `net` and `io` sensors not showing any values. --- app/Sensor.hs | 4 ++-- 1 file 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) -- cgit v1.2.3