Skip to content

Latest commit

 

History

History
110 lines (81 loc) · 1.65 KB

README.md

File metadata and controls

110 lines (81 loc) · 1.65 KB

leaf-connect

Node.js client library for the Nissan Leaf API

Requirements

Install node.js

Installation

npm install leaf-connect

Usage

Example

See examples/index.js

Setup client

const leafConnect = require('leaf-connect')

try {
  const client = await leafConnect({
    username: 'your-nissan-you@email.com',
    password: 'password'
    /*
      regionCode: 'NE', // See "region codes" section in docs
      locale: 'en-US',
      debug: true.
      pollingInterval: 30000 // in seconds
    */
  })
} catch (error) {
  console.error(error)
}

Methods

sessionInfo

client.sessionInfo()

status

await client.status()

cachedStatus

await client.cachedStatus()

climateControlStatus

await client.climateControlStatus()

climateControlTurnOn

await client.climateControlTurnOn()

climateControlTurnOff

await client.climateControlTurnOff()

chargingStart

await client.chargingStart()

history

await client.history()

location (removed?)

await client.location()

Region codes

Region Code
Europe NE
Canada NCI
USA NNA
Australia NMA
Japan NML

Acknowledgements

This library was inspired by Jason Horne's pywings2 Carwings library for Python.

License

MIT

About

Created with ❤ for Alheimsins