UNPKG

tesla-fleet-api

Version:

A library for the [Tesla Fleet API](https://developer.tesla.com/docs/fleet-api), and the third parties services [Teslemetry](https://teslemetry.com/docs/getting-started/api) and [Tessie](https://developer.tessie.com/docs/tesla-api-comparison), which provi

25 lines 927 B
import TeslaFleetApi from "./teslafleetapi.js"; export default class Telemetry extends TeslaFleetApi { constructor(accessToken, region = "api") { super({ accessToken, server: `https://${region}.teslemetry.com`, partnerScope: false, userScope: false }); } /** * Test the connection to Teslemetry */ async test() { return this._request("GET", "/api/test").then(({ response }) => response); } /** * Get details about your Teslemetry account * @param update_region Update the server URL based on the region in the metadata */ async metadata(update_region = true) { return this._request("GET", "/api/metadata").then((metadata) => { if (update_region) { this.server = `https://${metadata.region.toLowerCase()}.teslemetry.com`; } return metadata; }); } } //# sourceMappingURL=teslemetry.js.map