How to use the teslajs.getModel function in teslajs

To help you get started, we’ve selected a few teslajs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geraldoramos / nikola / tesla-api.js View on Github external
tjs.vehicle(options, function (err, vehicle) {
            console.log('run login ' + new Date())
            if (err) {
                console.log(err)
                reject(err)
                return
            }
            resolve({
                authToken: authToken,
                vehicleID: vehicle.id_s,
                model: tjs.getModel(vehicle),
                state: vehicle.state
            })
        });
    })},
github mseminatore / alexa-tesla / index.js View on Github external
str += " vehicle. ";
            }

            for (var i = 0; i < vehicles.length; i++) {
                if (i === 0) {
                    str += "A ";
                } else {
                    str += " and a ";
                }

                var paintColor = tjs.getPaintColor(vehicles[i]);
                if (paintColor) {
                    str += paintColor + " ";
                }

                str += tjs.getModel(vehicles[i]);

                if (vehicles[i].display_name) {
                    str += " called " + vehicles[i].display_name;
                }
            }
            log(str);
            res.say(str).send();
        },
        function(err) {