Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then( function(vehicles) {
// get options object - which must include authToken and vehicleID
var options = getOptionsFromCarName(session, carName);
tjs.chargeStateAsync(options)
.done( function(chargeState) {
var str = "";
if (options.display_name) {
str = options.display_name;
} else {
str = "The car";
}
if (chargeState.charging_state != "Disconnected") {
str += " is plugged in.";
} else {
str += " is not plugged in.";
}
res.say(str).send();
});