{-# LANGUAGE OverloadedStrings #-} module HomeAssistant.Controller.Switch (switchService) where import Data.Bool (bool) import HomeAssistant.Controller.Service (Service (..), Target) switchService :: [Target] -> Bool -> Service switchService targets b = Service { serviceDomain="switch" , serviceName= bool "turn_off" "turn_on" b , serviceData=Nothing , serviceTarget=targets }