Safe Haskell | None |
---|---|
Language | Haskell2010 |
Tesla
Description
Tesla
is intended to provide access to all known Tesla APIs as
documented at https://tesla-api.timdorr.com/
Synopsis
- authenticate :: AuthInfo -> IO AuthResponse
- refreshAuth :: AuthInfo -> AuthResponse -> IO AuthResponse
- data AuthResponse = AuthResponse {}
- data Product
- = ProductVehicle { }
- | ProductEnergy { }
- | ProductPowerWall
- vehicleName :: Traversal' Product Text
- vehicleID :: Traversal' Product VehicleID
- energyID :: Traversal' Product EnergyID
- _ProductVehicle :: Prism' Product (Text, VehicleID)
- _ProductEnergy :: Prism' Product EnergyID
- _ProductPowerWall :: Prism' Product ()
- type VehicleID = Text
- vehicles :: MonadIO m => AuthInfo -> m (Map Text Text)
- products :: MonadIO m => AuthInfo -> m [Product]
- type EnergyID = Integer
- energyIDs :: MonadIO m => AuthInfo -> m [EnergyID]
- fromToken :: String -> AuthInfo
- authOpts :: AuthInfo -> Options
- baseURL :: String
- decodeProducts :: Value -> [Product]
Documentation
authenticate :: AuthInfo -> IO AuthResponse Source #
Authenticate to the Tesla service.
refreshAuth :: AuthInfo -> AuthResponse -> IO AuthResponse Source #
Refresh authentication credentials using a refresh token.
data AuthResponse Source #
An Authentication response.
Constructors
AuthResponse | |
Fields
|
Instances
Show AuthResponse Source # | |
Defined in Tesla.Auth Methods showsPrec :: Int -> AuthResponse -> ShowS # show :: AuthResponse -> String # showList :: [AuthResponse] -> ShowS # | |
Generic AuthResponse Source # | |
Defined in Tesla.Auth Associated Types type Rep AuthResponse :: Type -> Type # | |
FromJSON AuthResponse Source # | |
Defined in Tesla.Auth | |
type Rep AuthResponse Source # | |
Defined in Tesla.Auth type Rep AuthResponse = D1 (MetaData "AuthResponse" "Tesla.Auth" "tesla-0.2.0.0-6Kg9IZLFiTKLTa1rstQAdL" False) (C1 (MetaCons "AuthResponse" PrefixI True) (S1 (MetaSel (Just "_access_token") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "_expires_in") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "_refresh_token") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))) |
Tesla Product Types.
Constructors
ProductVehicle | |
Fields
| |
ProductEnergy | |
ProductPowerWall |
_ProductPowerWall :: Prism' Product () Source #
vehicles :: MonadIO m => AuthInfo -> m (Map Text Text) Source #
Get a mapping of vehicle name to vehicle ID.
products :: MonadIO m => AuthInfo -> m [Product] Source #
Get all products associated with this account.
decodeProducts :: Value -> [Product] Source #