IKEA buttons
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user