tescmd 0.1.2__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tescmd/__init__.py +1 -1
- tescmd/api/client.py +8 -1
- tescmd/api/errors.py +8 -0
- tescmd/api/vehicle.py +19 -1
- tescmd/cache/response_cache.py +3 -2
- tescmd/cli/auth.py +30 -2
- tescmd/cli/key.py +149 -14
- tescmd/cli/main.py +44 -0
- tescmd/cli/setup.py +230 -22
- tescmd/cli/vehicle.py +464 -1
- tescmd/crypto/__init__.py +3 -1
- tescmd/crypto/ecdh.py +9 -0
- tescmd/crypto/schnorr.py +191 -0
- tescmd/deploy/tailscale_serve.py +154 -0
- tescmd/models/__init__.py +0 -2
- tescmd/models/auth.py +19 -0
- tescmd/models/config.py +1 -0
- tescmd/models/energy.py +0 -9
- tescmd/protocol/session.py +10 -3
- tescmd/telemetry/__init__.py +19 -0
- tescmd/telemetry/dashboard.py +227 -0
- tescmd/telemetry/decoder.py +284 -0
- tescmd/telemetry/fields.py +248 -0
- tescmd/telemetry/flatbuf.py +162 -0
- tescmd/telemetry/protos/__init__.py +4 -0
- tescmd/telemetry/protos/vehicle_alert.proto +31 -0
- tescmd/telemetry/protos/vehicle_alert_pb2.py +42 -0
- tescmd/telemetry/protos/vehicle_alert_pb2.pyi +44 -0
- tescmd/telemetry/protos/vehicle_connectivity.proto +23 -0
- tescmd/telemetry/protos/vehicle_connectivity_pb2.py +40 -0
- tescmd/telemetry/protos/vehicle_connectivity_pb2.pyi +33 -0
- tescmd/telemetry/protos/vehicle_data.proto +768 -0
- tescmd/telemetry/protos/vehicle_data_pb2.py +136 -0
- tescmd/telemetry/protos/vehicle_data_pb2.pyi +1336 -0
- tescmd/telemetry/protos/vehicle_error.proto +23 -0
- tescmd/telemetry/protos/vehicle_error_pb2.py +44 -0
- tescmd/telemetry/protos/vehicle_error_pb2.pyi +39 -0
- tescmd/telemetry/protos/vehicle_metric.proto +22 -0
- tescmd/telemetry/protos/vehicle_metric_pb2.py +44 -0
- tescmd/telemetry/protos/vehicle_metric_pb2.pyi +37 -0
- tescmd/telemetry/server.py +293 -0
- tescmd/telemetry/tailscale.py +300 -0
- {tescmd-0.1.2.dist-info → tescmd-0.2.0.dist-info}/METADATA +72 -35
- {tescmd-0.1.2.dist-info → tescmd-0.2.0.dist-info}/RECORD +47 -22
- {tescmd-0.1.2.dist-info → tescmd-0.2.0.dist-info}/WHEEL +0 -0
- {tescmd-0.1.2.dist-info → tescmd-0.2.0.dist-info}/entry_points.txt +0 -0
- {tescmd-0.1.2.dist-info → tescmd-0.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package telemetry.vehicle_alerts;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/teslamotors/fleet-telemetry/protos";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// VehicleAlerts is a collection of recent alerts.
|
|
11
|
+
message VehicleAlerts {
|
|
12
|
+
repeated VehicleAlert alerts = 1;
|
|
13
|
+
google.protobuf.Timestamp created_at = 2;
|
|
14
|
+
string vin = 3;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Audience the target audience for the alert.
|
|
18
|
+
enum Audience {
|
|
19
|
+
Unknown = 0;
|
|
20
|
+
Customer = 1;
|
|
21
|
+
Service = 2;
|
|
22
|
+
ServiceFix = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// VehicleAlert is a single alert and is active if ended_at is nil.
|
|
26
|
+
message VehicleAlert {
|
|
27
|
+
string name = 1;
|
|
28
|
+
repeated Audience audiences = 2;
|
|
29
|
+
google.protobuf.Timestamp started_at = 3;
|
|
30
|
+
google.protobuf.Timestamp ended_at = 4;
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: vehicle_alert.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'vehicle_alert.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13vehicle_alert.proto\x12\x18telemetry.vehicle_alerts\x1a\x1fgoogle/protobuf/timestamp.proto\"\x84\x01\n\rVehicleAlerts\x12\x36\n\x06\x61lerts\x18\x01 \x03(\x0b\x32&.telemetry.vehicle_alerts.VehicleAlert\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0b\n\x03vin\x18\x03 \x01(\t\"\xb1\x01\n\x0cVehicleAlert\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\taudiences\x18\x02 \x03(\x0e\x32\".telemetry.vehicle_alerts.Audience\x12.\n\nstarted_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nded_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp*B\n\x08\x41udience\x12\x0b\n\x07Unknown\x10\x00\x12\x0c\n\x08\x43ustomer\x10\x01\x12\x0b\n\x07Service\x10\x02\x12\x0e\n\nServiceFix\x10\x03\x42/Z-github.com/teslamotors/fleet-telemetry/protosb\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'vehicle_alert_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z-github.com/teslamotors/fleet-telemetry/protos'
|
|
36
|
+
_globals['_AUDIENCE']._serialized_start=397
|
|
37
|
+
_globals['_AUDIENCE']._serialized_end=463
|
|
38
|
+
_globals['_VEHICLEALERTS']._serialized_start=83
|
|
39
|
+
_globals['_VEHICLEALERTS']._serialized_end=215
|
|
40
|
+
_globals['_VEHICLEALERT']._serialized_start=218
|
|
41
|
+
_globals['_VEHICLEALERT']._serialized_end=395
|
|
42
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
4
|
+
from google.protobuf.internal import containers as _containers
|
|
5
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import message as _message
|
|
8
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
9
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
10
|
+
|
|
11
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
12
|
+
|
|
13
|
+
class Audience(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
14
|
+
__slots__ = ()
|
|
15
|
+
Unknown: _ClassVar[Audience]
|
|
16
|
+
Customer: _ClassVar[Audience]
|
|
17
|
+
Service: _ClassVar[Audience]
|
|
18
|
+
ServiceFix: _ClassVar[Audience]
|
|
19
|
+
Unknown: Audience
|
|
20
|
+
Customer: Audience
|
|
21
|
+
Service: Audience
|
|
22
|
+
ServiceFix: Audience
|
|
23
|
+
|
|
24
|
+
class VehicleAlerts(_message.Message):
|
|
25
|
+
__slots__ = ("alerts", "created_at", "vin")
|
|
26
|
+
ALERTS_FIELD_NUMBER: _ClassVar[int]
|
|
27
|
+
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
28
|
+
VIN_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
alerts: _containers.RepeatedCompositeFieldContainer[VehicleAlert]
|
|
30
|
+
created_at: _timestamp_pb2.Timestamp
|
|
31
|
+
vin: str
|
|
32
|
+
def __init__(self, alerts: _Optional[_Iterable[_Union[VehicleAlert, _Mapping]]] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., vin: _Optional[str] = ...) -> None: ...
|
|
33
|
+
|
|
34
|
+
class VehicleAlert(_message.Message):
|
|
35
|
+
__slots__ = ("name", "audiences", "started_at", "ended_at")
|
|
36
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
AUDIENCES_FIELD_NUMBER: _ClassVar[int]
|
|
38
|
+
STARTED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
39
|
+
ENDED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
40
|
+
name: str
|
|
41
|
+
audiences: _containers.RepeatedScalarFieldContainer[Audience]
|
|
42
|
+
started_at: _timestamp_pb2.Timestamp
|
|
43
|
+
ended_at: _timestamp_pb2.Timestamp
|
|
44
|
+
def __init__(self, name: _Optional[str] = ..., audiences: _Optional[_Iterable[_Union[Audience, str]]] = ..., started_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., ended_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package telemetry.vehicle_connectivity;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/teslamotors/fleet-telemetry/protos";
|
|
8
|
+
|
|
9
|
+
// VehicleConnectivity represents connection status change for the vehicle
|
|
10
|
+
message VehicleConnectivity {
|
|
11
|
+
string vin = 1;
|
|
12
|
+
string connection_id = 2;
|
|
13
|
+
ConnectivityEvent status = 3;
|
|
14
|
+
google.protobuf.Timestamp created_at = 4;
|
|
15
|
+
string network_interface = 5;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// ConnectivityEvent represents connection state of the vehicle
|
|
19
|
+
enum ConnectivityEvent {
|
|
20
|
+
UNKNOWN = 0;
|
|
21
|
+
CONNECTED = 1;
|
|
22
|
+
DISCONNECTED = 2;
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: vehicle_connectivity.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'vehicle_connectivity.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1avehicle_connectivity.proto\x12\x1etelemetry.vehicle_connectivity\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc7\x01\n\x13VehicleConnectivity\x12\x0b\n\x03vin\x18\x01 \x01(\t\x12\x15\n\rconnection_id\x18\x02 \x01(\t\x12\x41\n\x06status\x18\x03 \x01(\x0e\x32\x31.telemetry.vehicle_connectivity.ConnectivityEvent\x12.\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11network_interface\x18\x05 \x01(\t*A\n\x11\x43onnectivityEvent\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tCONNECTED\x10\x01\x12\x10\n\x0c\x44ISCONNECTED\x10\x02\x42/Z-github.com/teslamotors/fleet-telemetry/protosb\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'vehicle_connectivity_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z-github.com/teslamotors/fleet-telemetry/protos'
|
|
36
|
+
_globals['_CONNECTIVITYEVENT']._serialized_start=297
|
|
37
|
+
_globals['_CONNECTIVITYEVENT']._serialized_end=362
|
|
38
|
+
_globals['_VEHICLECONNECTIVITY']._serialized_start=96
|
|
39
|
+
_globals['_VEHICLECONNECTIVITY']._serialized_end=295
|
|
40
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
4
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import message as _message
|
|
7
|
+
from collections.abc import Mapping as _Mapping
|
|
8
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
9
|
+
|
|
10
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
11
|
+
|
|
12
|
+
class ConnectivityEvent(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
13
|
+
__slots__ = ()
|
|
14
|
+
UNKNOWN: _ClassVar[ConnectivityEvent]
|
|
15
|
+
CONNECTED: _ClassVar[ConnectivityEvent]
|
|
16
|
+
DISCONNECTED: _ClassVar[ConnectivityEvent]
|
|
17
|
+
UNKNOWN: ConnectivityEvent
|
|
18
|
+
CONNECTED: ConnectivityEvent
|
|
19
|
+
DISCONNECTED: ConnectivityEvent
|
|
20
|
+
|
|
21
|
+
class VehicleConnectivity(_message.Message):
|
|
22
|
+
__slots__ = ("vin", "connection_id", "status", "created_at", "network_interface")
|
|
23
|
+
VIN_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
CONNECTION_ID_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
26
|
+
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
27
|
+
NETWORK_INTERFACE_FIELD_NUMBER: _ClassVar[int]
|
|
28
|
+
vin: str
|
|
29
|
+
connection_id: str
|
|
30
|
+
status: ConnectivityEvent
|
|
31
|
+
created_at: _timestamp_pb2.Timestamp
|
|
32
|
+
network_interface: str
|
|
33
|
+
def __init__(self, vin: _Optional[str] = ..., connection_id: _Optional[str] = ..., status: _Optional[_Union[ConnectivityEvent, str]] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., network_interface: _Optional[str] = ...) -> None: ...
|