IKEA buttons

This commit is contained in:
2026-08-20 23:40:14 +03:00
parent 2a1bca73d7
commit 4d689be6ea
4 changed files with 76 additions and 5 deletions
+7
View File
@@ -24,6 +24,7 @@ module HomeAssistant.Controller
, lightController
, Presence(..)
, presence
, debug
) where
import AFRP (Mealy, eff, Event(..), hold, events, changes, filterA, (>>|), toEvent)
@@ -46,12 +47,18 @@ data Service = Service
data HASSEff a where
CallService :: Service -> HASSEff ()
Debug :: Show a => a -> HASSEff ()
type HASS a b = Mealy HASSEff a b
callService :: Service -> HASS a ()
callService service = eff (\_ -> CallService service)
debug :: Show a => HASS a a
debug = proc x -> do
eff Debug -< x
returnA -< x
ruuviTemperatures :: Mealy eff (Event Value) Double
ruuviTemperatures = entityRead @Double "sensor.ruuvitag_b168_temperature" >>> hold 0