packages feed

tesla 0.7.0.0 → 0.7.1.0

raw patch · 5 files changed

+44/−15 lines, 5 files

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for tesla +# Release 0.7.1.0++Updated some available commands.+ # Release 0.7.0.0  Authentication is no longer supported.
src/Tesla/Car/Command/Climate.hs view
@@ -3,7 +3,8 @@ {-# LANGUAGE TemplateHaskell   #-}  module Tesla.Car.Command.Climate (-  hvacOn, hvacOff, heatSeat, Seat(..),+  hvacOn, hvacOff, climateKeeper,+  heatSeat, coolSeat, Seat(..),   setTemps, wheelHeater, wheelHeaterOff, wheelHeaterOn,   maxDefrost,   wakeUp,@@ -13,6 +14,7 @@   ) where  import           Control.Monad.IO.Class (MonadIO (..))+import           Data.Aeson import           Tesla.Car.Command  -- | Turn on the steering wheel heater@@ -33,17 +35,22 @@  data Seat = DriverSeat | PassengerSeat | RearLeftSeat | RearCenterSeat | RearRightSeat +seatNum :: Seat -> Int+seatNum DriverSeat     = 0+seatNum PassengerSeat  = 1+seatNum RearLeftSeat   = 2+seatNum RearCenterSeat = 4+seatNum RearRightSeat  = 5++ -- | Set heating levels for various seats. heatSeat :: MonadIO m => Seat -> Int -> Car m CommandResponse heatSeat seat level = runCmd "remote_seat_heater_request" ["heater" .= seatNum seat, "level" .= level]-  where-    seatNum :: Seat -> Int-    seatNum DriverSeat     = 0-    seatNum PassengerSeat  = 1-    seatNum RearLeftSeat   = 2-    seatNum RearCenterSeat = 4-    seatNum RearRightSeat  = 5 +-- | Set heating 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]+ -- | Set the main HVAC temperatures. setTemps :: MonadIO m => (Double, Double) -> Car m CommandResponse setTemps (driver, passenger) = runCmd "set_temps" ["driver_temp" .= driver, "passenger_temp" .= passenger]@@ -83,6 +90,15 @@            Never        -> [e .= False, w .= False]            Always       -> [e .= True, w .= False]            WeekdaysOnly -> [e .= True, w .= True]++data ClimateKeeper = ClimateKeeperOff | ClimateKeeperDefault | DogMode | CampMode+  deriving (Eq, Show, Bounded, Enum)++instance ToJSON ClimateKeeper where+  toJSON = toJSON . fromEnum++climateKeeper :: MonadIO m => ClimateKeeper -> Car m CommandResponse+climateKeeper ck = runCmd "set_climate_keeper_mode" [ "climate_keeper_mode" .= ck]  mkNamedCommands [("hvacOn", "auto_conditioning_start"),                  ("hvacOff", "auto_conditioning_stop"),
src/Tesla/Car/Command/RemoteStart.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell   #-}  module Tesla.Car.Command.RemoteStart where @@ -6,8 +7,4 @@  import           Tesla.Car.Command --- | Enables keyless driving.------ This requires your account password, so, you know, be careful where you use it.-remoteStart :: MonadIO m => String -> Car m CommandResponse-remoteStart pw = runCmd "remote_start_drive" ["password" .= pw]+mkCommand "remoteStart" "remote_start_drive"
+ src/Tesla/Car/Command/Wake.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell   #-}++module Tesla.Car.Command.Wake (+  wakeUp+  ) where++import           Control.Monad.IO.Class (MonadIO (..))+import           Tesla.Car.Command++mkCommand "wakeUp" "wake_up"
tesla.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1725c4641e78097961719f44569b569c7e52a82a027e84d8d32cdf24c01ae3b0+-- hash: 9c3f0b9596ee29b8190747eac236e03c836b2b3b6f99c5a32b8cfb444277488d  name:           tesla-version:        0.7.0.0+version:        0.7.1.0 synopsis:       Tesla API client. description:    Please see the README on GitHub at <https://github.com/dustin/tesla#readme> category:       Web@@ -45,6 +45,7 @@       Tesla.Car.Command.Software       Tesla.Car.Command.SpeedLimit       Tesla.Car.Command.Valet+      Tesla.Car.Command.Wake       Tesla.Car.Command.Windows       Tesla.Car.Commands       Tesla.Energy