-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
26 lines (26 loc) · 871 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(async () => {
const leafConnect = require('../src')
try {
const client = await leafConnect({
username: process.env.LEAF_CONNECT_USERNAME || 'your-nissan-you@email.com',
password: process.env.LEAF_CONNECT_PASSWORD || 'password',
debug: true
/*
regionCode: 'NNA',
locale: 'en-US',
pollingInterval: 30000 // in seconds
*/
})
// console.log(client.sessionInfo())
console.log(await client.cachedStatus())
console.log(await client.status())
// console.log(await client.climateControlStatus())
// console.log(await client.climateControlTurnOn())
// console.log(await client.climateControlTurnOff())
// console.log(await client.chargingStart())
// console.log(await client.history())
// console.log(await client.location())
} catch (error) {
console.log(error)
}
})()