leaf-connect
v1.1.3
Published
Node.js client library for the Nissan Leaf API
Downloads
55
Maintainers
Readme
leaf-connect
Node.js client library for the Nissan Leaf API
Requirements
Install node.js
Installation
npm install leaf-connect
Usage
Example
Setup client
const leafConnect = require('leaf-connect')
try {
const client = await leafConnect({
username: '[email protected]',
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
About
Created with ❤ for Alheimsins