Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
Instances
Tesla Product Types.
_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 #