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