-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hi, I'm trying to set/get charge limit on several cars that I have, they are:
- 2019 Tesla Model 3
- 2023 BMW I4 EDrive40
- 2023 Audi e-tron
- 2019 MINI Cooper SE
and on all these cars, I get back the following error when trying to get or set charge limit using the following code:
app.get('/charge/limit', checkAccessToken, async (req, res) => {
try {
const { vehicles } = await smartcar.getVehicles(access.accessToken);
if (!vehicles.length) {
throw new Error('No vehicles found.');
}
const vehicle = new smartcar.Vehicle(vehicles[0], access.accessToken);
const chargeLimit = await vehicle.getChargeLimit();
res.json(chargeLimit);
} catch (error) {
res.status(500).json({ error: error.message });
}
});
<-- 500 Internal Server Error http://10.0.2.2:8000/charge/limit?accessToken=839ef1dc-ae4c-4432-bf09-32fc5dc9a9a5 (808ms)
10:08:44.586 I X-Powered-By: Express
10:08:44.586 I Content-Type: application/json; charset=utf-8
10:08:44.586 I Content-Length: 52
10:08:44.586 I ETag: W/"34-2mMGudYXKNPJ5R3gWWfz2c/XMQw"
10:08:44.586 I Date: Tue, 16 Jul 2024 08:08:45 GMT
10:08:44.586 I Connection: keep-alive
10:08:44.586 I Keep-Alive: timeout=5
10:08:44.587 I {"error":"vehicle.getChargeLimit is not a function"}
Metadata
Metadata
Assignees
Labels
No labels