@beejjacobs/nissan-connect
v1.0.17
Published
Nissan Connect API wrapper
Downloads
31
Maintainers
Readme
Nissan Connect
A Node js library for interacting with the Nissan Connect (Carwings) API. This provides a wrapper around the API to make it cleaner to use.
nissan-connect-app provides a front end and HTTP server, with local storage; using this module.
Example Usage
NissanConnect is promise based. Generated docs can be found here.
const NissanConnect = require('nissan-connect');
let nc = new NissanConnect('username','password');
async function things() {
//AC controls
await nc.acOn();
await nc.acOff();
await nc.setAcSchedule('2017-11-04 07:30');
let schedule = await nc.getAcSchedule();
console.log(schedule.targetDate);
// Battery status
let status = await nc.getBatteryStatus();
console.log(status.batteryStatus.chargeState);
console.log(status.batteryStatus.timeToFull3kW);
//Driving analysis
let drivingAnalysis = await nc.getDrivingAnalysisWeek('2017-11-01');
console.log(drivingAnalysis.startDate);
drivingAnalysis.days.forEach(daySummary => {
console.log(daySummary.targetDate);
if (daySummary.hasData) {
console.log(daySummary.averageEconomy);
console.log(daySummary.regen);
}
});
}
things().catch(console.error);