Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Tesla
is intended to provide access to all known Tesla APIs as
documented at https://www.teslaapi.io/
Synopsis
- authenticate :: AuthInfo -> IO AuthResponse
- refreshAuth :: AuthResponse -> IO AuthResponse
- data AuthResponse = AuthResponse {}
- data Product
- = ProductVehicle { }
- | ProductEnergy { }
- | ProductPowerwall {
- _pwID :: EnergyID
- _pwBatteryPower :: Double
- _pwEnergyLeft :: Double
- _pwCharged :: Double
- _pwName :: Text
- _pwTotal :: Double
- 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 (EnergyID, Double, Double, Double, Text, Double)
- pwBatteryPower :: Traversal' Product Double
- pwCharged :: Traversal' Product Double
- pwEnergyLeft :: Traversal' Product Double
- pwID :: Traversal' Product EnergyID
- pwName :: Traversal' Product Text
- pwTotal :: Traversal' Product Double
- type VehicleID = Text
- vehicles :: [Product] -> Map Text Text
- products :: MonadIO m => AuthInfo -> m [Product]
- productsRaw :: (FromJSON j, MonadIO m) => AuthInfo -> m j
- 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 #
Deprecated: Tesla busted authentication pretty hard. See https://github.com/dustin/tesla for more info.
Fail to authenticate to the Tesla service.
refreshAuth :: AuthResponse -> IO AuthResponse Source #
Refresh authentication credentials using a refresh token.
data AuthResponse Source #
An Authentication response.
Instances
Tesla Product Types.
ProductVehicle | |
ProductEnergy | |
ProductPowerwall | |
|
products :: MonadIO m => AuthInfo -> m [Product] Source #
Get all products associated with this account.
productsRaw :: (FromJSON j, MonadIO m) => AuthInfo -> m j Source #
productsRaw retrieves the complete response for products
data VehicleState Source #
Possible states a vehicle may be in.
Instances
Read VehicleState Source # | |
Defined in Tesla readsPrec :: Int -> ReadS VehicleState # readList :: ReadS [VehicleState] # | |
Show VehicleState Source # | |
Defined in Tesla showsPrec :: Int -> VehicleState -> ShowS # show :: VehicleState -> String # showList :: [VehicleState] -> ShowS # | |
Eq VehicleState Source # | |
Defined in Tesla (==) :: VehicleState -> VehicleState -> Bool # (/=) :: VehicleState -> VehicleState -> Bool # |
vsFromString :: Text -> VehicleState Source #
decodeProducts :: Value -> [Product] Source #
Decode a products response into a list of products.