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) {
var options = req.getSession().get("options");
tjs.climateStateAsync(options)
.done(function(climate_state) {
var state = climate_state.is_auto_conditioning_on ? "on" : "off";
var str = "The climate system is currently " + state + ". ";
if (climate_state.driver_temp_setting != climate_state.passenger_temp_setting ) {
str += "The driver temperature is set to " + Math.round(c2f(climate_state.driver_temp_setting)) + " degrees ";
str += "and the passenger temperature is set to " + Math.round(c2f(climate_state.passenger_temp_setting)) + " degrees.";
} else {
str += "The temperature is set to " + Math.round(c2f(climate_state.driver_temp_setting)) + " degrees.";
}
res.say(str).send();
});
});