tesla 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 60

Tesla for Dart Build Status

Control and monitor Tesla Products in Dart

Tesla.dart Changelog #

v0.0.1 #

  • Initial Version: No documentation.

v0.0.2 #

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

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.4 #

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

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}");
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  tesla: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.1.1 Apr 4, 2019 Go to the documentation of tesla 0.1.1 Download tesla 0.1.1 archive
0.1.0 Mar 24, 2019 Go to the documentation of tesla 0.1.0 Download tesla 0.1.0 archive
0.0.4 Feb 23, 2019 Go to the documentation of tesla 0.0.4 Download tesla 0.0.4 archive
0.0.3+1 Jan 20, 2019 Go to the documentation of tesla 0.0.3+1 Download tesla 0.0.3+1 archive
0.0.3 Jan 20, 2019 Go to the documentation of tesla 0.0.3 Download tesla 0.0.3 archive
0.0.2 Jan 13, 2019 Go to the documentation of tesla 0.0.2 Download tesla 0.0.2 archive
0.0.1 Jan 8, 2019 Go to the documentation of tesla 0.0.1 Download tesla 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
33
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Apr 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:tesla/tesla.dart.

Health issues and suggestions

Document public APIs. (-0.95 points)

646 out of 647 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/types/vehicle.dart. (-2.96 points)

Analysis of lib/src/types/vehicle.dart reported 6 hints, including:

line 65 col 35: Use = to separate a named parameter from its default value.

line 134 col 36: Use = to separate a named parameter from its default value.

line 188 col 36: Use = to separate a named parameter from its default value.

line 188 col 54: Use = to separate a named parameter from its default value.

line 216 col 40: Use = to separate a named parameter from its default value.

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

Analysis of lib/src/impl/common/http.dart reported 5 hints:

line 143 col 21: Use = to separate a named parameter from its default value.

line 144 col 20: Use = to separate a named parameter from its default value.

line 151 col 21: Use = to separate a named parameter from its default value.

line 152 col 20: Use = to separate a named parameter from its default value.

line 158 col 23: Use = to separate a named parameter from its default value.

Fix bin/proxy.dart. (-1.49 points)

Analysis of bin/proxy.dart reported 3 hints:

line 80 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 84 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 113 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix additional 6 files with analysis or formatting issues. (-2.50 points)

Additional issues in the following files:

  • bin/report.dart (1 hint)
  • bin/status.dart (1 hint)
  • bin/swupdate.dart (1 hint)
  • lib/src/impl/browser.dart (1 hint)
  • lib/src/impl/io.dart (1 hint)
  • lib/tool.dart (Run dartfmt to format lib/tool.dart.)

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 >=1.17.0 <3.0.0