22 lines
553 B
Haskell
22 lines
553 B
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module HomeAssistant.Controller.Scene
|
|
( activateScene
|
|
, activateSceneWith
|
|
) where
|
|
|
|
import Data.Aeson (Value)
|
|
import qualified Data.Text as T
|
|
import HomeAssistant.Controller.Service (Service (..), Target (..))
|
|
|
|
activateScene :: T.Text -> Service
|
|
activateScene sceneId = activateSceneWith sceneId Nothing
|
|
|
|
activateSceneWith :: T.Text -> Maybe Value -> Service
|
|
activateSceneWith sceneId d = Service
|
|
{ serviceDomain="scene"
|
|
, serviceName= "turn_on"
|
|
, serviceTarget= [EntityId sceneId]
|
|
, serviceData = d
|
|
}
|