tesla-0.2.0.0: Tesla API client.

Safe HaskellNone
LanguageHaskell2010

Tesla

Description

Tesla is intended to provide access to all known Tesla APIs as documented at https://tesla-api.timdorr.com/

Synopsis

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
Show AuthResponse Source # 
Instance details

Defined in Tesla.Auth

Generic AuthResponse Source # 
Instance details

Defined in Tesla.Auth

Associated Types

type Rep AuthResponse :: Type -> Type #

FromJSON 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.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))))

data Product Source #

Tesla Product Types.

Instances
Eq Product Source # 
Instance details

Defined in Tesla

Methods

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

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

Read Product Source # 
Instance details

Defined in Tesla

Show Product Source # 
Instance details

Defined in Tesla

type VehicleID = Text Source #

A VehicleID.

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.

type EnergyID = Integer Source #

An energy site ID.

energyIDs :: MonadIO m => AuthInfo -> m [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.