Safe Haskell | None |
---|---|
Language | Haskell2010 |
Tesla
Description
Tesla
is intended to provide access to all known Tesla APIs as
documented at https://www.teslaapi.io/
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
- vehicleState :: Traversal' Product VehicleState
- energyID :: Traversal' Product EnergyID
- _ProductVehicle :: Prism' Product (Text, VehicleID, VehicleState)
- _ProductEnergy :: Prism' Product EnergyID
- _ProductPowerWall :: Prism' Product ()
- type VehicleID = Text
- vehicles :: [Product] -> Map Text Text
- products :: MonadIO m => AuthInfo -> m [Product]
- data VehicleState
- vsFromString :: Text -> VehicleState
- type EnergyID = Integer
- energyIDs :: [Product] -> [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
Tesla Product Types.
Constructors
ProductVehicle | |
Fields | |
ProductEnergy | |
ProductPowerWall |
_ProductPowerWall :: Prism' Product () Source #
products :: MonadIO m => AuthInfo -> m [Product] Source #
Get all products associated with this account.
data VehicleState Source #
Possible states a vehicle may be in.
Instances
Eq VehicleState Source # | |
Defined in Tesla | |
Read VehicleState Source # | |
Defined in Tesla Methods readsPrec :: Int -> ReadS VehicleState # readList :: ReadS [VehicleState] # | |
Show VehicleState Source # | |
Defined in Tesla Methods showsPrec :: Int -> VehicleState -> ShowS # show :: VehicleState -> String # showList :: [VehicleState] -> ShowS # |
vsFromString :: Text -> VehicleState Source #
decodeProducts :: Value -> [Product] Source #