Drawer controller

This commit is contained in:
2026-08-21 00:01:12 +03:00
parent 0c3413c1c6
commit 5f0aad4e85
3 changed files with 29 additions and 1 deletions
+10
View File
@@ -25,6 +25,7 @@ module HomeAssistant.Controller
, Presence(..)
, presence
, debug
, switch
) where
import AFRP (Mealy, eff, Event(..), hold, events, changes, filterA, (>>|), toEvent)
@@ -98,6 +99,15 @@ light entityIds b = Service
, serviceTarget=entityIds
}
-- Name conflict with AFRP
switch :: [T.Text] -> Bool -> Service
switch entityIds b = Service
{ serviceDomain="switch"
, serviceName= bool "turn_off" "turn_on" b
, serviceData=Nothing
, serviceTarget=entityIds
}
lightController :: HASS (Event Value) (Event DoorState)
lightController = proc ev -> do
doorState <- door -< ev