npm.io
1.1.5 • Published 1 year ago

leaf-connect

Licence
MIT
Version
1.1.5
Deps
1
Size
9 kB
Vulns
26
Weekly
0

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

Keywords