{-# LANGUAGE OverloadedStrings #-}

module Tesla.Car.Command.Homelink (homelink) where

import           Control.Monad.IO.Class (MonadIO (..))
import           Tesla.Car.Command

-- | Trigger nearby homelink with the given (lat,lon)
homelink :: MonadIO m => (Double, Double) -> Car m CommandResponse
homelink :: forall (m :: * -> *).
MonadIO m =>
(Double, Double) -> Car m CommandResponse
homelink (Double
lat,Double
lon) = forall (m :: * -> *).
MonadIO m =>
String -> [Pair] -> Car m CommandResponse
runCmd String
"flash_lights" [Key
"lat" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
lat, Key
"lon" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
lon]