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
+5 -2
View File
@@ -26,7 +26,7 @@ import HomeAssistant.Runtime.Connection (readerAction, writerAction)
import HomeAssistant.Runtime.Supervisor (defaultBackoff, supervised)
import Network.Socket (withSocketsDo)
import System.Environment (getEnv)
import HomeAssistant.Controller.Bedroom (bedroomPresenceController)
import HomeAssistant.Controller.Bedroom (bedroomPresenceController, bedroomButtonController)
step :: (forall x. eff x -> IO x) -> Mealy eff a b -> a -> IO (b, Mealy eff a b)
step nt (Mealy f) a = do
@@ -36,7 +36,10 @@ step nt (Mealy f) a = do
data Controller = forall b. Controller T.Text (HASS (Event Value) b)
controllers :: [Controller]
controllers = [Controller "bedroom-presence" bedroomPresenceController]
controllers =
[ Controller "bedroom-presence" bedroomPresenceController
, Controller "bedroom-button" bedroomButtonController
]
-- | Steps the machine for every inbound message; service calls go to the
-- bus. A restart re-dups the inbound channel and starts from the machine's