{-# 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) = String -> [Pair] -> Car m CommandResponse
forall (m :: * -> *).
MonadIO m =>
String -> [Pair] -> Car m CommandResponse
runCmd String
"flash_lights" [Key
"lat" Key -> Double -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Double
lat, Key
"lon" Key -> Double -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Double
lon]