tesla 0.7.1.0 → 0.7.2.0
raw patch · 5 files changed
+21/−11 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Tesla.Car.Command.Climate: wakeUp :: forall {m}. MonadIO m => Car m CommandResponse
+ Tesla.Car.Command.Climate: CampMode :: ClimateKeeper
+ Tesla.Car.Command.Climate: ClimateKeeperDefault :: ClimateKeeper
+ Tesla.Car.Command.Climate: ClimateKeeperOff :: ClimateKeeper
+ Tesla.Car.Command.Climate: DogMode :: ClimateKeeper
+ Tesla.Car.Command.Climate: data ClimateKeeper
- Tesla.Car: _Closed :: forall a_asDR. Prism' (OpenState a_asDR) a_asDR
+ Tesla.Car: _Closed :: forall a_asHs. Prism' (OpenState a_asHs) a_asHs
- Tesla.Car: _Open :: forall a_asDR. Prism' (OpenState a_asDR) a_asDR
+ Tesla.Car: _Open :: forall a_asHs. Prism' (OpenState a_asHs) a_asHs
- Tesla.Car.Command.Wake: wakeUp :: forall {m}. MonadIO m => Car m CommandResponse
+ Tesla.Car.Command.Wake: wakeUp :: MonadIO m => Car m (Maybe Value)
Files
- src/Tesla/Car/Command/Climate.hs +3/−5
- src/Tesla/Car/Command/Wake.hs +14/−3
- src/Tesla/Car/Commands.hs +1/−0
- src/Tesla/Internal/HTTP.hs +1/−1
- tesla.cabal +2/−2
src/Tesla/Car/Command/Climate.hs view
@@ -3,11 +3,10 @@ {-# LANGUAGE TemplateHaskell #-} module Tesla.Car.Command.Climate (- hvacOn, hvacOff, climateKeeper,+ hvacOn, hvacOff, ClimateKeeper(..), climateKeeper, heatSeat, coolSeat, Seat(..), setTemps, wheelHeater, wheelHeaterOff, wheelHeaterOn, maxDefrost,- wakeUp, bioweaponMode, Sometimes(..), OffPeakConfig(..), Preconditioning, scheduledDepartureOff, scheduleDeparture@@ -47,7 +46,7 @@ heatSeat :: MonadIO m => Seat -> Int -> Car m CommandResponse heatSeat seat level = runCmd "remote_seat_heater_request" ["heater" .= seatNum seat, "level" .= level] --- | Set heating levels for various seats.+-- | Set cooling levels for various seats. coolSeat :: MonadIO m => Seat -> Int -> Car m CommandResponse coolSeat seat level = runCmd "remote_seat_cooler_request" ["seat_position" .= seatNum seat, "seat_cooler_level" .= level] @@ -101,6 +100,5 @@ climateKeeper ck = runCmd "set_climate_keeper_mode" [ "climate_keeper_mode" .= ck] mkNamedCommands [("hvacOn", "auto_conditioning_start"),- ("hvacOff", "auto_conditioning_stop"),- ("wakeUp", "wake_up")]+ ("hvacOff", "auto_conditioning_stop")]
src/Tesla/Car/Command/Wake.hs view
@@ -1,11 +1,22 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeApplications #-} module Tesla.Car.Command.Wake ( wakeUp ) where +import Control.Lens import Control.Monad.IO.Class (MonadIO (..))+import Data.Aeson+import Data.Aeson.Lens+import qualified Data.ByteString.Lazy as BL+++import Tesla.Car (currentVehicleID, vehicleURL) import Tesla.Car.Command+import Tesla.Internal.HTTP (jpostAuth) -mkCommand "wakeUp" "wake_up"+wakeUp :: MonadIO m => Car m (Maybe Value)+wakeUp = do+ v <- currentVehicleID+ preview (_Just . key "response") <$> jpostAuth @_ @(Maybe Value) (vehicleURL v "wake_up") BL.empty
src/Tesla/Car/Commands.hs view
@@ -22,4 +22,5 @@ import Tesla.Car.Command.Software as CMD import Tesla.Car.Command.SpeedLimit as CMD import Tesla.Car.Command.Valet as CMD+import Tesla.Car.Command.Wake as CMD import Tesla.Car.Command.Windows as CMD
src/Tesla/Internal/HTTP.hs view
@@ -34,4 +34,4 @@ jpostWith opts u v = view responseBody <$> liftIO (postWith opts u v >>= asJSON) jpostAuth :: (HasTeslaAuth m, FromJSON j, Postable a, MonadIO m) => String -> a -> m j-jpostAuth u v = teslaAuth >>= \a -> jpostWith (authOpts a) u v+jpostAuth u v = teslaAuth >>= \a -> jpostWith (authOpts a & header "Content-Type" .~ ["application/json"]) u v
tesla.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 9c3f0b9596ee29b8190747eac236e03c836b2b3b6f99c5a32b8cfb444277488d+-- hash: 10fd401a397b5deea0c592f1f9fd9ee0443e0aa037897aa94ea4dd12f8379dfc name: tesla-version: 0.7.1.0+version: 0.7.2.0 synopsis: Tesla API client. description: Please see the README on GitHub at <https://github.com/dustin/tesla#readme> category: Web