tesla-0.7.4.0: Tesla API client.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Tesla

Description

Tesla is intended to provide access to all known Tesla APIs as documented at https://www.teslaapi.io/

Synopsis

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

Instances details
FromJSON AuthResponse Source # 
Instance details

Defined in Tesla.Auth

ToJSON AuthResponse Source # 
Instance details

Defined in Tesla.Auth

Generic AuthResponse Source # 
Instance details

Defined in Tesla.Auth

Associated Types

type Rep AuthResponse :: Type -> Type #

Show AuthResponse Source # 
Instance details

Defined in Tesla.Auth

type Rep AuthResponse Source # 
Instance details

Defined in Tesla.Auth

type Rep AuthResponse = D1 ('MetaData "AuthResponse" "Tesla.Auth" "tesla-0.7.4.0-A0Al2DdpZxqCqV9OqkhIhJ" '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))))

data Product Source #

Tesla Product Types.

Instances

Instances details
Read Product Source # 
Instance details

Defined in Tesla

Show Product Source # 
Instance details

Defined in Tesla

Eq Product Source # 
Instance details

Defined in Tesla

Methods

(==) :: Product -> Product -> Bool #

(/=) :: Product -> Product -> Bool #

type VehicleID = Text Source #

A VehicleID.

vehicles :: [Product] -> 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.

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

Instances details
Read VehicleState Source # 
Instance details

Defined in Tesla

Show VehicleState Source # 
Instance details

Defined in Tesla

Eq VehicleState Source # 
Instance details

Defined in Tesla

type EnergyID = Integer Source #

An energy site ID.

energyIDs :: [Product] -> [EnergyID] Source #

Get a list of Solar ID installations.

fromToken :: String -> AuthInfo Source #

Get an AuthInfo instance from a bearer token.

authOpts :: AuthInfo -> Options Source #

Get a set of wreq options from an AuthInfo.

decodeProducts :: Value -> [Product] Source #

Decode a products response into a list of products.