tesla 0.3.0

Tesla for Dart Build Status

Control and monitor Tesla Products in Dart

Tesla.dart Changelog #

v0.3.0 #

The v10 update!

  • Support for triggering the HomeLink.
  • Doors, frunk, and trunk open states are now available.
  • Add homelinkDeviceCount getter to VehicleState.
  • Add isSmartSummonAvailable getter to VehicleState.
  • Add centerDisplayActive getter to VehicleState.
  • Add SummonVisualizationMessage to allow drawing of the summon visualization.
  • Add SummonFindMeRequestMessage that will allow summoning to a certain location.

v0.2.0 #

  • Drop support for Dart v1.x.x
  • Add setSentryMode command, and support for isSentryMode getter.

v0.1.2 #

  • More reworking, cleans up code and minor improvements.

v0.0.4 #

  • Rework HTTP implementation to share code more.
  • Allow using BASE64-encoded passwords for the standard tool API.
  • Fix a bug with typing.

v0.0.3 #

  • Reorganize code to allow custom endpoints.
  • Allow injecting API tokens.
  • Rename OptionCode to VehicleOptionCode.
  • Basic support for the browser (requires an API proxy).

v0.0.2 #

  • Abstract API and cleanup.
  • Option code support.
  • Support for software updates.
  • Multi-platform support.

v0.0.1 #

  • Initial Version: No documentation.

example/tesla.dart

import 'dart:async';

import 'package:tesla/tool.dart';

Future main() async {
  var client = getTeslaClient();
  for (var vehicle in await client.listVehicles()) {
    print("Vehicle ${vehicle.displayName} is ${vehicle.state}");
  }
  client.close();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  tesla: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:tesla/tesla.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Feb 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-0.96 points)

791 out of 792 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/vehicle/option_codes.dart. (-25 points)

Analysis of lib/src/vehicle/option_codes.dart reported 381 hints, including:

line 14 col 7: Avoid const keyword.

line 17 col 7: Avoid const keyword.

line 20 col 7: Avoid const keyword.

line 23 col 7: Avoid const keyword.

line 26 col 7: Avoid const keyword.

Fix lib/src/impl/common/http.dart. (-9.08 points)

Analysis of lib/src/impl/common/http.dart reported 19 hints, including:

line 28 col 17: Unnecessary new keyword.

line 50 col 15: Unnecessary new keyword.

line 63 col 13: Unnecessary new keyword.

line 73 col 20: Unnecessary new keyword.

line 81 col 12: Unnecessary new keyword.

Fix lib/src/impl/common/summon.dart. (-8.17 points)

Analysis of lib/src/impl/common/summon.dart reported 17 hints, including:

line 10 col 7: Unnecessary new keyword.

line 38 col 11: Unnecessary new keyword.

line 38 col 30: Unnecessary new keyword.

line 41 col 15: Unnecessary new keyword.

line 47 col 15: Unnecessary new keyword.

Fix additional 21 files with analysis or formatting issues. (-39.46 points)

Additional issues in the following files:

  • lib/src/types/vehicle.dart (12 hints)
  • lib/src/types/seat_heater.dart (11 hints)
  • bin/report.dart (8 hints)
  • bin/proxy.dart (6 hints)
  • lib/src/types/all_vehicle_state.dart (6 hints)
  • lib/src/impl/io.dart (5 hints)
  • lib/tool.dart (5 hints)
  • lib/src/types/vehicle_state.dart (4 hints)
  • bin/status.dart (3 hints)
  • bin/summon.dart (3 hints)
  • lib/src/impl/browser.dart (3 hints)
  • lib/src/token.dart (3 hints)
  • lib/src/client.dart (2 hints)
  • lib/src/types/drive_state.dart (2 hints)
  • bin/homelink.dart (1 hint)
  • bin/swupdate.dart (1 hint)
  • lib/src/endpoints.dart (1 hint)
  • lib/src/types/charge_state.dart (1 hint)
  • lib/src/types/climate_state.dart (1 hint)
  • lib/src/types/gui_settings.dart (1 hint)
  • lib/src/vehicle/summon.dart (1 hint)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0